cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fernanda
Resolver I
Resolver I

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

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

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,623)