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

Flow Fails when Comments Field in Manual Trigger is NULL

I'm sure this is something simple but I cannot figure it out. I am taking input from a manual trigger and populating a SharePoint list after some manipulation in Excel. If  the Comments field has text it works fine, but errors out on Create Item when the Comments field is NULL. Is there a way around this?

 

Issue with NULL Value.jpgFlow Error.jpg

 

1 ACCEPTED SOLUTION

Accepted Solutions
animartis
Level: Powered On

Re: Flow Fails when Comments Field in Manual Trigger is NULL

Can someone give me some detail on how to use the coalesce function? I've seen this solution posted several times but haven't figured out how to use the function. 

 

For example, @equals(coalesce(trigger().outputs?.body?.propertyX, 'NULL'),  'NULL')

 

Where and how would I apply this in my Flow?

View solution in original post

13 REPLIES 13
Dual Super User
Dual Super User

Re: Flow Fails when Comments Field in Manual Trigger is NULL

Hi @animartis 

 

Looks like some of the trigger properties were updated

Remove the Comments and checkoincheckout dynamic content and re-map them

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

animartis
Level: Powered On

Re: Flow Fails when Comments Field in Manual Trigger is NULL

I deleted both the Check In/Out and Comments, saved, exited, re-opened Flow and added them back. Same issue.

Dual Super User
Dual Super User

Re: Flow Fails when Comments Field in Manual Trigger is NULL

@animartis 

 

share screenshot of create item action (I want to see all the properties)

animartis
Level: Powered On

Re: Flow Fails when Comments Field in Manual Trigger is NULL

@RezaDorraniI expanded both the manual trigger and Create Item in my original post. Is that what you need?

Dual Super User
Dual Super User

Re: Flow Fails when Comments Field in Manual Trigger is NULL

Hi @animartis 

 

Fill only title field and see if it works

then start filling one by one and then figure out which column is causing the issue

it might be related to a type mismatch between sharepoint column and the value u r providing

animartis
Level: Powered On

Re: Flow Fails when Comments Field in Manual Trigger is NULL

Thanks @RezaDorrani 

 

I definitely know that it is the Comments field because I previously had that field mandatory in the manual trigger and it worked fine. It is only when I make the field optional that it errors out. I definitely believe it is related to a NULL value being passed, but I'm not sure how overcome that. I've verified that the SharePoint column is set to not required and is a text field as well. Hope that helps and thanks for the assistance!

Dual Super User
Dual Super User

Re: Flow Fails when Comments Field in Manual Trigger is NULL

Hi @animartis 

 

add a compose action before the create item action

for the compose action set its value as the comments dynamic content

 

run flow and check value in case of no comment provided

 

Dual Super User
Dual Super User

Re: Flow Fails when Comments Field in Manual Trigger is NULL

Hey @animartis 

 

This is a known issue with optional input types in manually triggered (or any other trigger that has any manual inputs and those are passed as null) in Flow. 

 

Please take a look at the screenshot below: 

Err1.PNG

 

Err2.PNG

You can proabably use this and replicate in your flow too. The manual trigger has a Comment input that is optional. I am trying to initialize a variable with that input and if there is no value passed while triggering the flow, this is bound to fail. And then I am setting an action to run only if that initialize action fails and adding any consecutive steps. At the end remember to add the terminate action with status succeeded or else the flow will register as failed. 

 

And if there are inputs passed in the comments while triggering the flow, the normal path can be followed. 

 

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!

Super User
Super User

Re: Flow Fails when Comments Field in Manual Trigger is NULL

@animartis 

I haven't  tested this yet, but try using the coalesce function.

 

 

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

Scott
animartis
Level: Powered On

Re: Flow Fails when Comments Field in Manual Trigger is NULL

@yashag2255 

 

I might be doing something wrong, but it is not failing at the initialization of the variable, instead it fails at the Create Item. Would this still work?

animartis
Level: Powered On

Re: Flow Fails when Comments Field in Manual Trigger is NULL

Can someone give me some detail on how to use the coalesce function? I've seen this solution posted several times but haven't figured out how to use the function. 

 

For example, @equals(coalesce(trigger().outputs?.body?.propertyX, 'NULL'),  'NULL')

 

Where and how would I apply this in my Flow?

View solution in original post

Highlighted
Super User
Super User

Re: Flow Fails when Comments Field in Manual Trigger is NULL

@animartis 

The coalesce() expression returns the first non-null value out of the values that you supply.

It is useful when you want to supply a default value.

coalesce(value1,value2,value3)

 

 

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

Scott
animartis
Level: Powered On

Re: Flow Fails when Comments Field in Manual Trigger is NULL

@ScottShearer 

 

Thanks Scott, I finally got it to work! Here is a screenshot of how it looks in the end. I didn't know how to get the right name for the coalesce function (read: n00b) but found that if you peek code or hover over the name it gives you the value.

 

For the other newbies out there, this expression will look for the first non NULL value (as Scott stated). In this case, it uses the ''.

 

pic1.jpgpic2.jpg

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 (4,346)