cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HMJ_Somerset
Frequent Visitor

Error creating a List entry with blank date field from a MS Form

I have a MS Form to capture requests for a service.  The form has several date fields, but are not mandatory as they may not be relevant to the request (e.g Question 1 - have you had a recent COVID-19 test? Question 2 - If yes, please enter the date)

I have set up a Power Automate flow to process new Form submissions and enter the details into a SharePoint List, however I am getting the following error when a date field is left blank.

The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/Date_x0020_of_x0020_Planned_x002' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.

 

How do I create the list items when the From has blank date fields?  If I were to manually complete the form there would be no problem not entering a date in the list field.

 

FlowError_Date.png

1 ACCEPTED SOLUTION

Accepted Solutions
HMJ_Somerset
Frequent Visitor

Update on the original post - 

 

I found the solution in this post on the Building Flows forum Flow fails to Create SharePoint list item if data type date is blanks.

 

I followed the solution and created an If expression in the field that checked if the response was blank 

if(equals(outputs('Get_response_details')?['body/rcd8db3e8317d40cf804c76b89caf4cb7'],'')

and if blank entered a null value

,null

or the date response if there was a value

formatDateTime(outputs('Get_response_details')?['body/r7bf27a2bed93456ca71c844977a3fd4b'])

Full expression is: 

if(equals(outputs('Get_response_details')?['body/r7bf27a2bed93456ca71c844977a3fd4b'],''),null,formatDateTime(outputs('Get_response_details')?['body/r7bf27a2bed93456ca71c844977a3fd4b']))

View solution in original post

3 REPLIES 3
CFernandes
Super User III
Super User III

Hello @HMJ_Somerset ,,

 

Instead of passing an empty value just try to pass 

 

utcNow()
 

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!

HMJ_Somerset
Frequent Visitor

Sorry for my ignorance, but won't this put today's date in a field that should be intentionally left blank?

HMJ_Somerset
Frequent Visitor

Update on the original post - 

 

I found the solution in this post on the Building Flows forum Flow fails to Create SharePoint list item if data type date is blanks.

 

I followed the solution and created an If expression in the field that checked if the response was blank 

if(equals(outputs('Get_response_details')?['body/rcd8db3e8317d40cf804c76b89caf4cb7'],'')

and if blank entered a null value

,null

or the date response if there was a value

formatDateTime(outputs('Get_response_details')?['body/r7bf27a2bed93456ca71c844977a3fd4b'])

Full expression is: 

if(equals(outputs('Get_response_details')?['body/r7bf27a2bed93456ca71c844977a3fd4b'],''),null,formatDateTime(outputs('Get_response_details')?['body/r7bf27a2bed93456ca71c844977a3fd4b']))

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (89,316)