cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fernanda
Helper III
Helper III

Using IF formula after email body split not working

Hello!!

 

I am trying to obtain certain data from an email body and convert them into different acronyms.

 

So far, I was able to extract the info I needed with a split formula, and identifying each parameter

 

Fernanda_0-1653406985916.png

split(outputs('Html_a_texto_Cuerpo_email')?['body'],outputs('Tecla_Enter'))
 
Fernanda_1-1653407021780.png

This is the result I need.

 

This, so far, works perfectly.

 

But, and here is my main issue, is that I need to turn that result into an acronym.

For example: Aguas A S.A. has to be turned into ARA, Aguas Al into ADA, and so on.

I was using an if formula, adding an equals: 

if(equals(outputs('Empresa'),'Aguas A S.A.'),'ARA','OTHER')
Note: OTHER is supposed to be another formula comparing Aguas Al into ADA and so on, but tried to test the logic first.
 
And here, no matter what I do, I keep getting OTHER as result, when it is supposed to be a true result and show ARA.
Tried initialiazing a variable as string, using " character... but nothing.
 
Fernanda_2-1653407637215.pngFernanda_3-1653407649117.png

 

 
Can you help me please?
Thank you in advance!!
1 ACCEPTED SOLUTION

Accepted Solutions
v-liwei-msft
Microsoft
Microsoft

Hi @Fernanda ,

 

Your compose "Empresa" returns an array instead of a string.

You can use the join function to convert the result into a string and compare it:

if(equals(join(outputs('Compose'),','),'Aguas A S.A.'),'ARA','OTHER')

 I have made test for your reference:

vliweimsft_0-1653557765232.png

 

vliweimsft_1-1653557765235.png

 

Best Regards,

Levi

View solution in original post

2 REPLIES 2
v-liwei-msft
Microsoft
Microsoft

Hi @Fernanda ,

 

Your compose "Empresa" returns an array instead of a string.

You can use the join function to convert the result into a string and compare it:

if(equals(join(outputs('Compose'),','),'Aguas A S.A.'),'ARA','OTHER')

 I have made test for your reference:

vliweimsft_0-1653557765232.png

 

vliweimsft_1-1653557765235.png

 

Best Regards,

Levi

brilliant!!

thank you so much!!!

I had also tried with a initializing a variable thinking it could have convert the array into a string. This totally fixed my issue.

Thank you so so so much!!!

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 (2,598)