cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dnndev
Level: Powered On

Empty choice field value in SharePoint causing flow to fail

Hi There,

 

I have serveral choice fields that are not required to have value, when I am using that in Microsoft Flow I am getting the following error 

 

 

Unable to process template language expressions in action 'Send_an_email' inputs at line '1' and column '1752': 

'The template language expression 'coalesce(body('Get_item')?['Column'],body('Get_item')?['Column']['Value'],'')' cannot be evaluated because property 'Value' cannot be selected. 

Please see https://aka.ms/logicexpressions for usage details.'.

 

I am using the coalesce forumla after I got the similar error by just using body('Get_item')?['Column']['Value'],

 

If I used the below formula I get the empty value if no value is chosen in SharePoint form. 

 

coalesce(body('Get_item')?['Column'],'')

But when there is a selection I get the value like below

 

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

 

I have also seen several post asking to use a condition action, using it would be very tedious and error prone as I have too many such columns like it.

 

Please let me knoe if you know how I could implement a logic for empty and non-empty fields

 

If none works then only option I am left with is to use default values for the choice fields.

 

Thanks

DNN

 

3 REPLIES 3
Super User
Super User

Re: Empty choice field value in SharePoint causing flow to fail

I am not sure if this is what you are looking for, but I was able to check for an empty option column by using the empty() function/expression.

 

Does this solve your issue?

 

.Empty1.jpgEmpty2.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Community Support Team
Community Support Team

Re: Empty choice field value in SharePoint causing flow to fail

Hi @dnndev,

 

Could you please share a screenshot of your flow's configuration?

 

If you use the coalesce() expression within Microsoft Flow, the function would return the first non-null object in the arguments passed. If the Choice field is not selected with an option on your side, the Choice field would return empty, so the Value property could not be detected within the Choice field.

 

I agree with @ScottShearer's thought almost, you could also consider take a try to add a empty() function within your Condition box to check if the Choice field is empty.

 

In addition, I think your thought is available. You could consider take a try to set a Default value for your Choice field within your SharePoint list. 

 

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.
hjaf
Level: Powered On

Re: Empty choice field value in SharePoint causing flow to fail

Stumbled upon this same issue myself. 

 

Why would the connector assume that "" means 0, if I give no parameter to the field then its accepted as no value. How is the value '' different from a variable with the value ''? this is confusing flow dark magic that I keep having to waste time on.. 

 

Is there another workaround other than using empty() in a condition? Using conditions means that I now havet to maintain two sharepoint updates instead of just one.

 

I'm starting to get more and more confused, Flow is supposed to make simpler.. right?

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,204)