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

Re: Assign Approval to User based off a Value in a Sharepoint List (nested switchcase or If statemen

@faustocapellanj

 

Thanks for the feedback. I tried your suggestion and still have the same issue.

 

I raised a service request with Microsoft on this particular issue after posting this, after a one hour skype meeting explaining my use case the support team came back yesterday and told me that it isn't possible to nest two if statements as I am trying. The only approach provided is to use switch cases and repeat all the follow on approvals and actions multiple times.

 

I will put this forward as an enhancement / idea and hope it gets votes!

 

Alan

Super User Rank
Super User

Re: Assign Approval to User based off a Value in a Sharepoint List (nested switchcase or If statemen

Hi @AlanPilz

I was able to do a Nested IF Statement and here's how I tested it:

I created a Flow with a Manually trigger a flow trigger. I set the input name to Vehicle Type and set it as a dropdown list with the values: Platform, Vehicle, Other.

if-1.JPG

 

I then added a Data Operations - Compose and created the following expression:

if(equals(triggerBody()['text'],'Platform'),concat(triggerBody()['text'],' was selected'),if(equals(triggerBody()['text'],'Vehicle'),concat(triggerBody()['text'],' was selected'), concat(triggerBody()['text'],' was selected')))

Here's the expression breakdown:

First IF Statement and the value to check if it's equals to:
if(equals(triggerBody()['text'],'Platform')
Value If True:
concat(triggerBody()['text'],' was selected'),
Value If False:
if(equals(triggerBody()['text'],'Vehicle'),concat(triggerBody()['text'],' was selected'), concat(triggerBody()['text'],' was selected')))

Of course, the second IF Statement contains it's own Value If True and Value If False. The screenshots below show the output after the successful run for each selected option in the dropdown menu:

 

if-platform.JPGPlatform selected

if-vehicle.JPGVehicle selected

if-other.JPGOther selected

Please give that a shot and let me know.

 

Regards,

Fausto Capellan, Jr





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

Proud to be a Flownaut!


>