cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mistysmith
Level: Powered On

UpdateContext depending on IF statement

Currently in my code I have the following that works:

 

// If Action is Change, skips AR Approval and goes to CM
UpdateContext({NewWFStatus: If(ThisItem.Action = "Change", "AwaitingCMApproval","AwaitingARApproval")});

 

I need to do the same thing if 3 field values are met.  I put in the following and it gives me an error.

 

UpdateContext({NewWFStatus: If(ThisItem.'Bill-To - New Bill-To' = "Yes" & ThisItem.Action = "Reactivate" & ThisItem.'A/R - Pay Terms Pay Type' = "Yes", "AwaitingCMApproval","AwaitingARApproval")});

 

 

Ideas???

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: UpdateContext depending on IF statement

You should use either the && operator or the And operator, not the & operator.

 

Try this:

 

UpdateContext({NewWFStatus: If(ThisItem.'Bill-To - New Bill-To' = "Yes" && ThisItem.Action = "Reactivate" && ThisItem.'A/R - Pay Terms Pay Type' = "Yes", "AwaitingCMApproval","AwaitingARApproval")});

View solution in original post

2 REPLIES 2
Highlighted

Re: UpdateContext depending on IF statement

You should use either the && operator or the And operator, not the & operator.

 

Try this:

 

UpdateContext({NewWFStatus: If(ThisItem.'Bill-To - New Bill-To' = "Yes" && ThisItem.Action = "Reactivate" && ThisItem.'A/R - Pay Terms Pay Type' = "Yes", "AwaitingCMApproval","AwaitingARApproval")});

View solution in original post

mistysmith
Level: Powered On

Re: UpdateContext depending on IF statement

Thank you!!!   I'm fairly new.  I took this over from a contractor that did the initial build.  I'm learning as I go!



 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,679)