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

If expression - If false, "Do Nothing"

I have an MS form that updates a pre-existing MS list of records via an Automate flow. The form is comprised of Yes/No questions.

 

joshualee98_0-1649657375291.png

 

I would like to update the value of the record (a number column) if the form answer is 'Yes', while retaining the existing value if the answer is 'No', either by "doing nothing" or by reinserting the existing value back into the record.

 

So far, my expression works for the 'Yes' condition, but not for a 'No':

if(equals(outputs('Get_response_details')?['body/rd00106f45b1b42fcb37e348d77e9a079'],'Yes'),4,DO NOTHING)
 
I have tried using false, which returns an error, and null, which zeroes out the value.
Any help would be much appreciated. Thanks!
5 REPLIES 5
Ahammad_Riyaz
Super User
Super User

Hi @joshualee98 ,

 

You can use conditions, based on that yes no will work as expected.

 

Regards

Ahammad Riyaz

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

fchopo
Super User
Super User

Hi @joshualee98 

Try using the following expression:

if(equals(outputs('Get_response_details')?['body/rd00106f45b1b42fcb37e348d77e9a079'],'Yes'),4,item()?['Q1'])

As item()?['Q1'] will get current value from SharePoint field.

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hi @Ahammad_Riyaz,

 

Thanks for your suggestion. Unfortunately, it's not quite what I'm looking for as using a condition in my use case would be impractical.

 

Josh

Hi @fchopo

 

Thanks for the suggestion, it's definitely along the lines of what I'm looking for. I gave it a go though and unfortunately, it just ended up clearing the value for some reason.

fchopo
Super User
Super User

Hi @joshualee98 

Just check that your previous value is not empty, since the expression should work with no problem.

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,407)