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

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
efialttes
Super User III
Super User III

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

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

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (77,623)