Reputation: 31
I am trying to create an intake process where where a response from a Microsoft Form creates an item into our SharePoint queue for my team to work. This workflow has some branching so some questions may not always need answers. When the "Date of Change" field is used as intended in the workflow by the user, everything works correctly and appears in our queue. When the user goes down a path where the "Date of Change" field is not needed or a part of the workflow, I receive the below error and the results are never pushed to our queue.
Error Message: The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/DateofChange' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.
To fix this I have tried making the field "Not required" in hopes that if left blank it would not get read by the flow.
I have also tried, changing the format of the column from Date and time to Single Line of Text and neither of those have worked.
Upvotes: 2
Views: 14755
Reputation: 11
I was not able to get the expression to succeed that @Expiscornovus suggested, but I was able to use the following expression successfully:
if(empty(body('Get_response_details')?['FieldnameID']), null, body('Get_response_details')?['FieldnameID'])
Where FieldnameID
is the ID of the Microsoft Forms field. In my case, it looked like this:
if(empty(body('Get_response_details')?['rf09f2130133c45f781d451551bae1234']), null, body('Get_response_details')?['rf09f2130133c45f781d451551bae1234'])
Upvotes: 1
Reputation: 1497
Try an expression instead of the dynamic content field. In this expression check for empty with the empty function. If it is empty use the null value.
Below is an example
Make sure you change the question id to your question id in the expression.
if(empty(outputs('Get_response_details')?['body/rec7e8e58aab84f49a27cacc460a7eeaf']), null, outputs('Get_response_details')?['body/rec7e8e58aab84f49a27cacc460a7eeaf'])
Upvotes: 0