cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

True / False to Yes/No in HTML Table

hi all,

 

I have a HTML table which has been created from a JSON array object. 

 

I have a number of fields which the output is a "Yes/No" field in sharepoint but this transposes to "true/false" on power automate.

 

how can I best amend these fields so it will convert the True/False to Yes/No for easier reading?

 

The Parse JSON object

 

parseJson.png

directly below is the create HTML table.

createHTMLtable.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @mrleetyler,

 

You could use two replace() function to replace the true to "Yes" and false to "No", before replace, we should use string() function to convert it to string, for example:

replace(replace(string(outputs('Compose')),'true','"Yes"'),'false','"No"')

Then use json() function convert the string to JSON back:

Screenshot 2020-11-17 144715.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

3 REPLIES 3
Community Support
Community Support

Hi @mrleetyler,

 

You could use two replace() function to replace the true to "Yes" and false to "No", before replace, we should use string() function to convert it to string, for example:

replace(replace(string(outputs('Compose')),'true','"Yes"'),'false','"No"')

Then use json() function convert the string to JSON back:

Screenshot 2020-11-17 144715.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

Super User III
Super User III

Or you could do it like this:

Breakfast.png

The expressions within the select are:

if(bool(item()['Breakfast']), 'Yes','No')
if(bool(item()['Lunch']), 'Yes','No')
if(bool(item()['Dinner']), 'Yes','No')

thanks tried this for learning and it does also resolve the issue 🙂 great that I now have 2 solutions in the event this ever comes up again.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (2,871)