
Announcements
Hi all. I've researched and debugged this several times, and I am not seeing a fix to handle the submission of a null value from a date picker control, submitted to a work flow with the run method that uses ask in PowerApps. The closest solution I saw was to turn on formula-level error management and that unfortunately hasn't worked.
Here is the background. I am using this technique based on the video link below, to pass arguments in the .Run method of the flow from the controls on the form behind an onSelect event of a submit button. The flow inserts a document into the library and updates some meta data columns using the Update File Properties and requests to Ask in Power Apps (see 18:45, and 22:50 of the video)
https://www.youtube.com/watch?v=C-DU1VYYa_0
This works fine but when I use a date picker control I have problems. I can submit the arguments to the flow from the date picker without issue if there is a value like so: 'myFlow'.Run(Text(myDatePickerControlValue.SelectedDate, "yyyy-mm-dd"))
Some other notes
The column is not required in SP.
The data control date picker is not set to required either (false)
The InputTextPlaceholder is set to the following:
If(IsBlank(Self.SelectedDate), Text(Blank()))
The problem happens since the date filed can be empty (it's not required) and I want to pass blank() that I get an error even with Formula level error management turned on. I understand this is happening because it is trying to format the value null as a date, or assumes the values passed are a string that can't be formatted as a date and it throws an error. The error is:
: { "error": { "code":
"TriggerInputSchemaMismatch", "message":
"The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'String '' does not validate against format 'date'.'.''}}
Now I understand why this is happening, but I figured turning the setting for error level management would fix this. Here is another video and some other links that talk about this problem
writing null values to database
Writing null to SP with date picker
https://www.youtube.com/watch?v=QPARYHl0THc
The code I have for the argument in the .run method to call the flow throws this error when there is no value in the datepicker control:
'myflow'.Run(
If(IsBlank(MyDataCardValueDate.SelectedDate), Text(Blank()), Text(MyDataCardValueDate.SelectedDate, "yyyy-mm-dd"))
)
I have tried replacing Text(Blank()) with just Blank() or "", but I still can't get past the error to make the flow run.
Not sure what I have to pass, or if I have to use some other method to get the flow to accept the AskInPower Apps going if there is no value.
Strangely.. when I test the flow manually it shows all the date controls with a red star as required??? Which makes me wonder why this is happening???
Any insight to an explanation and a fix would be great.
Thanks for your help.