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.
Any help would be appreciated 🙂
Solved! Go to Solution.
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.
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')
In 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:
Best Regards,
Charlie Choi
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).
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'.
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
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.
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')
In 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:
Best Regards,
Charlie Choi
Hi Charlie,
Thank you for your suggestion. Both of these options have worked perfectly (YAY!)
Have a great day!
Taren
User | Count |
---|---|
95 | |
48 | |
21 | |
19 | |
18 |
User | Count |
---|---|
137 | |
54 | |
42 | |
41 | |
30 |