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

IF Function: Combine Function and Text as Output

Hello Everyone

 

My Questions might seem simple enough, but i cant get it to work....

Basically just using an If as an output in my mail

This works just fine as it should

if(equals(int(outputs('Get_a_row')?['body/Bieri Daily']),2),'true','false')

 

Using an excel row as output works just fine aswell:

if(equals(int(outputs('Get_a_row')?['body/Bieri Daily']),2),outputs('Get_a_row')?['body/Bieri Daily'],'false')

 

But when i try to combine an excel row AND some text, it just refuses to be recognized as valid code:

if(equals(int(outputs('Get_a_row')?['body/Bieri Daily']),2),'The number is:'outputs('Get_a_row')?['body/Bieri Daily'],'false')

 

Does anyone know how i can work around this? It must be possible to have this as an output, right?

Greatly appreciate any suggestions, thanks fellas!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

You need to concat your "The number is" and the output, something like this:

if
(
	equals(int(outputs('Get_a_row')?['body/Bieri Daily']),2),
	concat('The number is:', outputs('Get_a_row')?['body/Bieri Daily']),'false'
)

 

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

View solution in original post

6 REPLIES 6
Paulie78
Super User III
Super User III

You need to concat your "The number is" and the output, something like this:

if
(
	equals(int(outputs('Get_a_row')?['body/Bieri Daily']),2),
	concat('The number is:', outputs('Get_a_row')?['body/Bieri Daily']),'false'
)

 

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

View solution in original post

Econ
Regular Visitor

You're an absolute Hero, thank you so much!

 

Also, is there any way to retain the formatting as you did? How do you even edit the code, i am lowkey doing it in a word sheet.... because it's no real programming language it won't be recognized as code in any editors....

It always resets any kind of formatting as soon as i insert the code in power automate aswell....

Paulie78
Super User III
Super User III

Do you mean the line spaces etc? I probably wrote it in the new experimental expression editor. But it could be that I wrote it in Notepad++ and copied and pasted it. I really just did that to make it easier for you to read.

 

Is your problem solved?

Econ
Regular Visitor

Yeah exactly thats what i mean.

I have tried the new expression editor aswell, but when i click save it just resets the entire formatting anyways....

Too bad there's no way to retain the formatting....

 

yes, it is! Hence why i accepted your response as an answer

Paulie78
Super User III
Super User III

For me, it retains the formatting (Both in the experimental and the normal). I assumed everything was the same for everyone, but I was helping someone out the other day and their expression editor was slightly different to mine, which I found surprising. But it was perhaps a location based thing as I am in the UK and they were in the USA (though I can't imagine why it would make a difference).

Econ
Regular Visitor

Interesting...

 

For me it looks like this (normal mode)

Econ_0-1604919262543.png

 

And yes haha, its absolutely unusable to code in, thats why i do everything in a word sheet (which is an absolute pain...). If you copy paste something into that window it'll just kill any type of formatting...

My Regions is Europe (Switzerland)

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,859)