I have a flow that takes the output of a Forms response and pushes it into a SharePoint online list. It's working well for the most part, but I have a multi-select question in my form and corresponding column in SharePoint that is erroring out. I have branching in my form, and so this question won't always have a response.
In my select block I get this error: BadRequest. The 'from' property value in the 'select' action inputs is of type 'Null'. The value must be an array.
The error details are: The 'from' property value in the 'select' action inputs is of type 'Null'. The value must be an array.
My select block looks like this:
The From value is referring to the relevant field in my form, with the json tag so it's not treated as a string:
json(outputs('Get_response_details')?['body/r44b6acfc7db144ceb6b572dc74494bca'])
I've tried with the mapping to just use item() but got the error, so I thought I could convince it to use an empty array entry if the field was null, like this:
if(equals(outputs('Get_response_details')?['body/r44b6acfc7db144ceb6b572dc74494bca'], null), json('[]'), json(outputs('Get_response_details')?['body/r44b6acfc7db144ceb6b572dc74494bca']))
That didn't help - I get the same error. I saw another post about this, with this example:
Is my problem that this expression isn't an array, even with the json() wrapper?
outputs('Get_response_details')?['body/r44b6acfc7db144ceb6b572dc74494bca']
Note that the variable is unrelated to this - it's for a different field that's working as expected, and I'm trying not to use a variable to this item.
The flow works correctly when that multi-select field in the form has one or more values in it, but fails whenever it is skipped due to branching. How can I adjust my Select block (or something else in my flow) to accommodate for a null value?
if(empty(outputs('Get_response_details')?['body/r44b6acfc7db144ceb6b572dc74494bca']), json('[]'), json(outputs('Get_response_details')?['body/r44b6acfc7db144ceb6b572dc74494bca']))