Skip to main content

Notifications

Power Automate - General Discussion
Answered

Run flow based on column values

(0) ShareShare
ReportReport
Posted on by 21

Hi All,

 

I'm trying to run a flow that will only calculate the time elapsed based on the values in column "Workforce Type". The flow should make the column "Elapsed Time FlowTest" look like column "Elapsed Days". The column "Elapsed Days" is a calculated column that calculates the days since from the "Requested Date Test" column based on if column "Workforce Type" doesn't equal "Yes". If it equals "Yes", it blanks out the elapsed days. My flow currently calculates the elapsed days for all column cells. How do I add the condition based on the "workforce type" value?

 

list1.png

 

Flow:

the expression for set variable varElapsedTime is:

 

div(sub(ticks(formatDateTime(utcNow())),ticks(outputs('Get_item')?['body/RequestedDate'])),864000000000)

 

flow2.png

  • soup3921 Profile Picture
    soup3921 21 on at
    Re: Run flow based on column values

    @Hardesh15Perfect, this worked. This was exactly what I was looking for. Thanks a bunch!

  • Verified answer
    Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Run flow based on column values

    @soup3921 

     

    Then use WorkforceType ne 'Yes' 

     

    Thanks

    Hardesh

  • soup3921 Profile Picture
    soup3921 21 on at
    Re: Run flow based on column values

    @Hardesh15I see. It's a "Choice" column type with internal name of "WorkforceType".

  • Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Run flow based on column values

    @soup3921 

     

    We use filter to reduce time for further flow execution. Example- suppose you need certain line items for specific column value then using filter query give only required result. 

    Filter query expression-

    SharePoint list internal column ne 'value' .  ne means not equal to and single quote is very important. For internal column go to list settings then click on column name after than see your url last part which is your internal column name.

    What is your column type which has Yes value?

     

    Thanks

    Hardesh

  • soup3921 Profile Picture
    soup3921 21 on at
    Re: Run flow based on column values

    @Hardesh15No. I have not used any filter query in any of the get items actions. I think I see where you're going though. Maybe enter an ODATA filter query that only gets list items where items under "Workforce Type" does not equal "Yes"? If that would work, what would be the formula? Disregard if this is not a good idea.

  • Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Run flow based on column values

    @soup3921 

     

    Have you used any filter query in Get items? please share with me.

     

    Thanks

    Hardesh

  • soup3921 Profile Picture
    soup3921 21 on at
    Re: Run flow based on column values

    @Hardesh15Sure, let me try explaining in another way. When the flow triggers, it should loop through each item under column "Workforce Type" to see if it doesn't equal "Yes". If this is true, then the flow should for each item under column "Elapsed Time FlowTest", calculate how many days it's been since the date under "Requested Date Test".

     

    If each item under column "Workforce Type" does equal "Yes", the flow should NOT calculate the days, so there should be no value under column "Elapsed Time FlowTest". Hope I explained it better. If not, let me know.

  • Hardesh15 Profile Picture
    Hardesh15 7,087 on at
    Re: Run flow based on column values

    @soup3921 

     

    "will only calculate the time elapsed based on the values in column "Workforce Type"."  i am not able to understand this part as later you wrote "If it equals "Yes", it blanks out the elapsed days".  please give more details

     

    Thanks

    Hardesh

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard