cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrandonQuinn
New Member

Null error when selecting from empty array

I have several mulitple choice questions in a Microsoft form. Multiple answers are allowed for the questions, and so after some Googling I am using Compose to get the answer array and then Select to select the items within that array to display when I automate the form responses into a SharePoint list. However, the new form I'm using branches off, and so some of the multiple choice fields are skipped and left blank. I then get the error "The 'from' property value in the 'select' action inputs is of type 'Null'. The value must be an array.". 

 

Has anyone come across this error before or knows another one to handle it?Flow Error.png

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Yes, you can handle this with an expression like this:

if(equals(outputs('somearray'), null), json('[]'), outputs('somearray'))

You would replace:

outputs('somearray') with whatever you array is. This expression is basically saying, if the array is equal to null, then use json('[]') as the output instead. which will produce a valid, but empty array.

View solution in original post

3 REPLIES 3
Paulie78
Super User
Super User

Yes, you can handle this with an expression like this:

if(equals(outputs('somearray'), null), json('[]'), outputs('somearray'))

You would replace:

outputs('somearray') with whatever you array is. This expression is basically saying, if the array is equal to null, then use json('[]') as the output instead. which will produce a valid, but empty array.

View solution in original post

BrandonQuinn
New Member

Thank you very much! This worked for all my branched multiple choice questions.

Thank you very much! This worked for all my branched multiple choise questions.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,148)