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

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

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

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

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

#### Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

We have closed kudos on this post at this time. Thank you to everyone who kudo'ed their RSVP--your invitations are coming soon!  Miss the window to RSVP? Don't worry--you can catch the recording of the meeting this week in the Community.  Details coming soon!   *****   It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3, 2024 at 9:30 AM PDT and join us for an engaging and informative session!