cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Help needed with IF and Else IF

Hi Guys!

 

I am building a flow where the i need to check two inputs from the user. My flow i triggerd on when a new list item i created in SharePoint, the list has a "Choice" field that is set to "pending" as default. I send out an email with options to the user, right after the email i want to check if the user picked one of the options in the email or if he changed Choice field value to "Approved". See the picture below of the flow idea.

 

New Flow.png

 

 

 

Is this possible with flow?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Help needed with IF and Else IF

Hi @SaadRH,

 

I don't think you will be able to check if the value has been manually updated in the Sharepoint list after the Send Email with Options action. From my understanding, the flow will wait until a response has been received from the Email before continuing so the user would still need to respond anyway.

What you could try instead is use a Parallel Branch before the Send Email with Options action. One branch can perform the process you already have, sending the email and then checking the reponse and updating if necessary. The second branch can call a Do Until action, using the Sharepoint list item's Choice column and checking if it is "Approved". Add a Delay Until action into this loop and set the delay value to 

addToTime(utcNow(),1,'Hour') so that it checks hourly. You may need to adjust the count and timeout to better suit your needs, depending on how much time generally passes between creation of the item and approval.
It might also be worthwhile using a Variable to indicate when the item has been processed. You can then set this to true in the branch that executes first, and have a check condition in both branches to confirm whether this Variable is still false before processing.
 
Hope that helps

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

5 REPLIES 5
Highlighted
Resolver III
Resolver III

Re: Help needed with IF and Else IF

Hi @SaadRH

I think I have exactly what you need. Heres a test flow I was using some time ago, you can modify User options with your options.

Capture.JPG

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Highlighted
Frequent Visitor

Re: Help needed with IF and Else IF

HI @Dorul

 

No that is not what i need. I have sharepoint list with the "Choice" column. When a new item is created the "Choice" column gets the default value of "Pending".

 

Now when i send out the email with the options, right after that i want to check if the user clicked the "Approve" button in the email or if he changed the "Choice" column value to "Approved" in the sharepoint list manually. Depending on what the user did the flow should continue in on to one block of actions. For example if the user clicked "Approve" in the email, flow should continue in Block A and if he changed the "Choice" value then flow should continue to Block B.

Highlighted
Super User
Super User

Re: Help needed with IF and Else IF

Hi @SaadRH,

 

I don't think you will be able to check if the value has been manually updated in the Sharepoint list after the Send Email with Options action. From my understanding, the flow will wait until a response has been received from the Email before continuing so the user would still need to respond anyway.

What you could try instead is use a Parallel Branch before the Send Email with Options action. One branch can perform the process you already have, sending the email and then checking the reponse and updating if necessary. The second branch can call a Do Until action, using the Sharepoint list item's Choice column and checking if it is "Approved". Add a Delay Until action into this loop and set the delay value to 

addToTime(utcNow(),1,'Hour') so that it checks hourly. You may need to adjust the count and timeout to better suit your needs, depending on how much time generally passes between creation of the item and approval.
It might also be worthwhile using a Variable to indicate when the item has been processed. You can then set this to true in the branch that executes first, and have a check condition in both branches to confirm whether this Variable is still false before processing.
 
Hope that helps

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

Highlighted
Frequent Visitor

Re: Help needed with IF and Else IF

Hi @LeeHarris

 

I was able to solve my problem. I did use Parallel branch.

 

One thing that i didn't understand was how exactly the "do until" action works. What exactly does the "Count" and the "Timeout" limits do?

 

For example i would want the loop to continue maximum 30 days from when it starts.

 

My do untill looks like this right now:

image.png

Highlighted
Super User
Super User

Re: Help needed with IF and Else IF

Hi @SaadRH

 

Count is the maximum number of times the Do Until loop will run (by default 60 times)

Timeout is the length of time before the Do Until loop stops (by default 1 hour from inital execution)

 

Execution of the loop will end when either of these values are met. For your scenario you would want to set Count to the max 5000, and Timeout to P30D.

 

Please refer to this post for more information regarding the Count and Timeout values.

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Limits-in-Do-Until-condition/td-p/170891

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (6,595)