Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

What 'ticks(outputs)' is used for in Power Automate flows?

(0) ShareShare
ReportReport
Posted on by 355

Hi,

I'm studying Power Automate flows and would like to better understand some expressions used inside the steps, but I couldn't find a related documentation.

I found the function ticks() with the parameter outputs inside a flow step.

Below the entire expression:

my-example.png

Can you please explain to me "step by step" the expression above?

Is the '?' a ternary operator (and if so, why do I need it here, and what the condition should be)?

I assume that "Test variable" is getting the value of the field datetobut where is defined which entity the field is taken from?

  • Joel D Profile Picture
    Joel D 355 on at
    RE: What 'ticks(outputs)' is used for in Power Automate flows?

    Hi,

    Thank you for your replies, which have been really useful.

    I found another expression which is not clear to me. This another one uses the function sub(A.B), but instead of B, it seems that there is a nested expression:

    sub(0, items('Name_of_the_previous_action_inside_the_current_step')?[nameOfTheFieldOfTheEntityRetrievedInThePreviousAction']).



    I assume that 0 is the minuend, the rest of the expression is the subtrahend

    Is it correct? If yes, the value returned for nameOfTheFieldOfTheEntityRetrievedInThePreviousAction will be 0 minus the value previously assigned to nameOfTheFieldOfTheEntityRetrievedInThePreviousAction ...but it does not make sense for me, so it most likely means something different, but I could not find any relevant example with the related explanation, could you please help?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: What 'ticks(outputs)' is used for in Power Automate flows?

    Hi,

    1. This expression returns the number of ticks since the specified timestamp, you can get more information about it from this official documentation:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#ticks

    2. The output expression is the output of the previous action.

    3. The '?' is not a ternary operator, it is used to get the next level of data, and use `? ` can avoid null error.

    For example, I added a compose action ,you can get the date from the output by using this expression:

    ticks(outputs('Compose')?['date'])

    The design for my Power Automate:

    pastedimage1625551274771v1.png

    This is my test result:

    pastedimage1625551459180v2.png

    4. The value of the ‘dateto’ field is created or received by your previous steps, just like the date field in my compose action.

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Frank Gong

  • Verified answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,321 on at
    RE: What 'ticks(outputs)' is used for in Power Automate flows?

    Hi,

    Thank you for your query.

    The expression calculates the ticks (interval) for the DateTo column.

    DateTo column is being read from the body/output from a previous step.

    Most probably, you will have a for-each step before this step, expressions calculate the ticks and stores in the Test Variable. If it is not for each, this is also possible, previous step is a web API call and the output is a JSON object (which is returned by web API).

    To find out which column is DateTo, look at the previous actions, or share a full snapshot of the flow.

    To understand the use of '?', please look at the following post:

    Solved: Use of Question Mark(?) in expressions - Power Platform Community (microsoft.com)

    Here is a nice post on ticks expression:

    Flow - Calculate Date Diference - Power Platform Community (microsoft.com)

    In general, following the Microsoft learning module is a good start to learn about expressions:

    Introduction to expressions in Power Automate - Learn | Microsoft Docs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,791 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,488 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans