I have built a form that collects several items and uses branching to bypass secondary questions if you say No to the primary question. For example:
Do you want Item#1 (Yes No)
If Yes
Start Date (using the built in picker for all of these date field)
End Date
If you choose no it skips to the next primary question
Do you want Item#2 (Yes No)
If Yes
Start Date
End Date
Form completed.
If the user selects "No" to Item#1 the start date and end date skipped. Using the Create Item for SharePoint action I have added IF statements when retrieving the the start dates and end dates to set the date as NULL if the field is empty. here is the formula
if(equals(outputs('Get_response_details')?['body/GUIDBlahBlah'],''),null,formatDateTime(outputs('Get_response_details')?['body/GUIDBlahBlah']))
When I run a test I get the following error.
Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string 'No' was not valid. The datetime string must match ISO 8601 format.'.
Any assistance would be great.