cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

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

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

Highlighted
Frequent Visitor

Re: Return a String instead of true/false

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (6,941)