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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,893)