cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

IF Logic when updating Excel with Variable

I receive an email with various fields that I then use Power Automate to update an Excel File. One of the fields is a department. I've assigned this as a variable and then assigned that variable to upload the cell in Excel. My issue is that one of the departments comes across as just the first part of the name, but the Excel file I'm working with needs the full name filled out. I can do this easily with an IF statement in Excel but I'd like to make this fully operable in Power Automate. I've tried this formula but I'm getting an error: 

 


IF(Variables('VerticalFinal')='Admin',concat(variables('VerticalFinal'),'istration'),variables('VerticalFinal')

 

 

My logic is: if Vertical Final says Admin then concat it to make it say Adminstration, else place just the VerticalFinal variable name. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: IF Logic when updating Excel with Variable

Hi
Replace
IF(Variables('VerticalFinal')='Admin',concat(variables('VerticalFinal'),'istration'),variables('VerticalFinal')
and use this instead
if(equals(variables('VerticalFinal'),'Admin'),concat(variables('VerticalFinal'),'istration'),variables('VerticalFinal'))
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
Highlighted
Dual Super User III
Dual Super User III

Re: IF Logic when updating Excel with Variable

Hi
Replace
IF(Variables('VerticalFinal')='Admin',concat(variables('VerticalFinal'),'istration'),variables('VerticalFinal')
and use this instead
if(equals(variables('VerticalFinal'),'Admin'),concat(variables('VerticalFinal'),'istration'),variables('VerticalFinal'))
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
New Member

Re: IF Logic when updating Excel with Variable

Thanks! That did the trick. I didn't know about the <equals> function. 

Highlighted
Dual Super User III
Dual Super User III

Re: IF Logic when updating Excel with Variable

Hi!
Just in case it helps you in the future, here you are the currently supported functions
https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

Happy flowing!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,431)