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

Expression - If Y/N column = Y then return text

Hi,

 

I have an expression that should return different text depending on whether a Y/N SharePoint Online column is answered Yes or No.

 

if(equals(triggerBody()?['checkbox'],true), 'It was noted that you contribute to a company vehicle. Please complete the relevant form as per the Fleet Management Procedure.', 'n/a')

 

 

I have attempted a number of different ways to get the condition i.e. 1, Yes, True, 'true', bool('True').

 

I am needing to repeat this logic for 2 other Y/N columns.

 TarenBhutch_0-1658202892459.png

 

 Any help would be appreciated 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @TarenBhutch ,

 

The expression you provided should work, i have made a simple test but it works fine on my side.

 

1. Here is my SharePoint List.

vyujincuimsft_0-1658474536098.png

2. Here is my Flow.

if(equals(outputs('Get_item')?['body/checkbox'],true),'It was noted that you contribute to a company vehicle. Please complete the relevant form as per the Fleet Management Procedure.','n/a')

vyujincuimsft_1-1658474551557.pngIn addition, maybe you could try the following expressions:

if(equals(string(outputs('Get_item')?['body/checkbox']),'True'),'It was noted that you contribute to a company vehicle. Please complete the relevant form as per the Fleet Management Procedure.','n/a')

Result Screenshot:

vyujincuimsft_2-1658474658597.png

 

 

Best Regards,
Charlie Choi

View solution in original post

5 REPLIES 5
MarconettiMarco
Super User
Super User

Hello @TarenBhutch ,

what’s the error you’re getting?

Are you sure that’s the SP column in Boolean type?

 

BR,

Marco

Hi @MarconettiMarco ,

 

I don't receive an error message. The expression always returns 'n/a'. In the below example, the Vehicle column was answered Yes, so should have returned 'It was noted that you contribute to a company vehicle. Please complete the relevant form as per the Fleet Management Procedure.'. However, it returned 'n/a' (see screenshot below).

 

TarenBhutch_1-1658266940148.png

 

 

Below are screenshots of the column settings in SPO which show it is a Y/N column and the original name for the column was called 'checkbox' not 'Company Vehicle'.

TarenBhutch_0-1658266559129.png

 

Thanks,

Taren

 

Ok @TarenBhutch ,

please add a “Compose” action before the Condition and put the value you want to check.

then run the flow and see in the Compose outputs the value you’re getting.

 

Please let me know.

 

BR,

Marco

v-yujincui-msft
Community Support
Community Support

Hi @TarenBhutch ,

 

The expression you provided should work, i have made a simple test but it works fine on my side.

 

1. Here is my SharePoint List.

vyujincuimsft_0-1658474536098.png

2. Here is my Flow.

if(equals(outputs('Get_item')?['body/checkbox'],true),'It was noted that you contribute to a company vehicle. Please complete the relevant form as per the Fleet Management Procedure.','n/a')

vyujincuimsft_1-1658474551557.pngIn addition, maybe you could try the following expressions:

if(equals(string(outputs('Get_item')?['body/checkbox']),'True'),'It was noted that you contribute to a company vehicle. Please complete the relevant form as per the Fleet Management Procedure.','n/a')

Result Screenshot:

vyujincuimsft_2-1658474658597.png

 

 

Best Regards,
Charlie Choi

Hi Charlie,

 

Thank you for your suggestion. Both of these options have worked perfectly (YAY!)

 

Have a great day!

Taren

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,478)