cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
oscarf
Regular Visitor

Convert True and False to Yes or No in Power Automate

Hello Power Automate Community,

 

Wondering what I'm i missing? Using the following Expression. So when i run the flow is only returning "No".

 

SharePoint list column Type:  Yes/No

 

if(equals(triggerBody()?['Does_x0020_this_x0020_project_x00'],True),'Yes','No')

 

Capture.PNGCapture1.PNG

 

Thank you in advance.

 

 

6 REPLIES 6
trad
Resolver II
Resolver II

Look at the values coming out from SharePoint. Yes/No columns actually store the value as "Yes" and "No" not True/False. E.g.

	"AddedtoLibrary": {
		"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
		"Id": 0,
		"Value": "Yes"
	}

 

oscarf
Regular Visitor

Hi @trad Thank you for the quick response. Just a little confused. What will be the correct Expression? Still learning Power Automate. My apologies.

 

Capture2.PNG

 

Thank you.

yashag2255
Dual Super User II
Dual Super User II

Hi @oscarf 

 

Can you try updating the expression as: 

if(equals(triggerBody()?['Does_x0020_this_x0020_project_x00'],true),'Yes','No')

and if that does not work, try: 

if(equals(triggerBody()?['Does_x0020_this_x0020_project_x00'],'true'),'Yes','No')

 

Hope this Helps! 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Also try

if(equals(toLower(triggerBody()?['Does_x0020_this_x0020_project_x00']),'true'),'Yes','No')

Thank you so much @yashag2255 Still getting back the same results. Very strange.

 

TrueandFalse.PNGTrueandFalse1.PNG

 

I try both expression. 

 

 

 

Thank you @VictorIvanidze Also, try your expression and got the following error.

The execution of template action 'Create_CSV_table' failed. The column values could not be evaluated: 'The template language function 'toLower' expects its parameter to be a string.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

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.

Users online (1,453)