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

Issue with empty MS Form date picker preventing new list item being created

So we have a MS Form that allows users to pick a date if there is a deadline for a project. However, this is not a required field so sometimes will be left empty which means my flow cannot complete in this case i.e. it cannot create a new list item if there is no date selected. I have added a branching question into the form so that the date picker question only appears if they select 'Yes there is a deadline for this project' but that hasn't helped. Any ideas? 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

The way Coalesce works is that it checks the values of the parameters from left to right.  It accepts the first one that is non-null.  So if you put the date field first and a null function second it will use the null function if the date field doesn't exist or is empty.



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

View solution in original post

8 REPLIES 8
Pstork1
Dual Super User III
Dual Super User III

Use Coalesce() to check the value of the incoming MS form field.  If its null because it wasn't entered have the Coalesce submit a null value to the date field.  That should leave it blank.



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

Thanks @Pstork1 - apologies but still learning how to use Power Automate. I don't see Coalesce as an option under operations in my flow or in the advanced settings of ay of my existing operations. How do I add this? My current steps:

When a new response is submitted
Get response details
Create item

 

Many thanks for your time.

 

Pstork1
Dual Super User III
Dual Super User III

Coalesce() is a function that you can enter using the expressions tab of the dynamic content dialog.  Here's a link to the documentation.  Use it to format the date field when adding it to the create item input.

Blank, Coalesce, IsBlank, and IsEmpty functions in Power Apps - Power Apps | Microsoft Docs



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

OK @Pstork1 - so where do I add this function? In one of my existing steps or do I need a new step? And if so, which one?

Pstork1
Dual Super User III
Dual Super User III

You can either use it in a Compose action, and then use the Compose in the Date field in Create item or just enter it into the date field directly.



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

I'm looking at the Compose action now. 

 

So I have added 'coalesce()' into the Inputs field of the Compose action.

Then in the Create item action I added Compose Outputs into the Deadline field but when I test the flow it fails at the Compose action. What have I done wrong?

VSTrath
Regular Visitor

Ah wait I should have added null in the brackets after coalesce?

Pstork1
Dual Super User III
Dual Super User III

The way Coalesce works is that it checks the values of the parameters from left to right.  It accepts the first one that is non-null.  So if you put the date field first and a null function second it will use the null function if the date field doesn't exist or is empty.



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

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,672)