cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
nbarta
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
Dual Super User
Dual Super User

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
Dual Super User
Dual Super User

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

nbarta
New Member

Re: IF Logic when updating Excel with Variable

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

Dual Super User
Dual Super User

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

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: 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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,813)