cancel
Showing results for
Did you mean:
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
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 helped you out, please give me some Kudos 👍

Thanks 😙

6 REPLIES 6
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 helped you out, please give me some Kudos 👍

Thanks 😙

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....

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.

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

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).

Regular Visitor

Interesting...

For me it looks like this (normal mode)

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)

Announcements

Check out the new Process Advisor community forum board!

#### Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

#### 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
Top Kudoed Authors
Users online (3,367)