cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nbarta
Regular Visitor

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

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

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!



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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,035)