cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
xKazuya
Level: Powered On

Return a String instead of true/false

Hi Community.

 

Situation: 

- App built with powerapps

- Contains a few toggle buttons 

- Workflow triggers when new item (sharepoint list) is created, then sends an email

 

Everything works fine, however, I want to change the text from "true" to "yes" and from "false" to "no". How can I do this in flow?

 

Many thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Return a String instead of true/false

Hi @xKazuya,

 

Could you please show a screenshot of your flow's configuration?

Do you want to change the text value from "true" to "yes" and "false" to "no"?

or change the boolean value from true to "yes" string and false to "no" string?

 

I think the if function could achieve your needs, I have made a test on my side and please take a try with the following workaround:

  • If you want to change the text value from "true" to "yes" and "false" to "no" (change from string to string).18.JPG

    Add a "Variable" -> "Initialize variable" action, Name set to TextValue, Type set to String, Value set to empty. The TextValue variable represents the text you want to change.

         Add a "Compose" action, Input set to following formula:

 

if(equals(variables('TextValue'),'true'),'yes','no')

If the Text value that you want o change is "true", the above "Compose" action would return "yes", if the Text value that you want o change is "false", the above "Compose" action would return "no".

 

19.JPG

 

  • If you want to change the boolean value from true to ''yes'' and false to ''no'' (change from Boolean to string).20.JPG

     

    Add a "Variable" -> "Initialize variable" action, Name set to TextValue, Type set to Boolean, Value set to empty. The TextValue variable represents the text you want to change.

         Add a "Compose" action, Input set to following formula:

if(equals(variables('TextValue'),true),'yes','no')

If the Text value that you want o change is true (boolean value), the above "Compose" action would return "yes", if the Text value that you want o change is false (boolean value), the above "Compose" action would return "no".21.JPG

 

 

More details about the if function in Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#logical-fu...

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Return a String instead of true/false

Hi @xKazuya,

 

Could you please show a screenshot of your flow's configuration?

Do you want to change the text value from "true" to "yes" and "false" to "no"?

or change the boolean value from true to "yes" string and false to "no" string?

 

I think the if function could achieve your needs, I have made a test on my side and please take a try with the following workaround:

  • If you want to change the text value from "true" to "yes" and "false" to "no" (change from string to string).18.JPG

    Add a "Variable" -> "Initialize variable" action, Name set to TextValue, Type set to String, Value set to empty. The TextValue variable represents the text you want to change.

         Add a "Compose" action, Input set to following formula:

 

if(equals(variables('TextValue'),'true'),'yes','no')

If the Text value that you want o change is "true", the above "Compose" action would return "yes", if the Text value that you want o change is "false", the above "Compose" action would return "no".

 

19.JPG

 

  • If you want to change the boolean value from true to ''yes'' and false to ''no'' (change from Boolean to string).20.JPG

     

    Add a "Variable" -> "Initialize variable" action, Name set to TextValue, Type set to Boolean, Value set to empty. The TextValue variable represents the text you want to change.

         Add a "Compose" action, Input set to following formula:

if(equals(variables('TextValue'),true),'yes','no')

If the Text value that you want o change is true (boolean value), the above "Compose" action would return "yes", if the Text value that you want o change is false (boolean value), the above "Compose" action would return "no".21.JPG

 

 

More details about the if function in Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#logical-fu...

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

xKazuya
Level: Powered On

Re: Return a String instead of true/false

Many thanks for your help, that did the job for me. 🙂

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,703)