web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Null error when select...
Power Automate
Unanswered

Null error when selecting from empty array

(0) ShareShare
ReportReport
Posted on by 7

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

Categories:
I have the same question (0)
  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    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.

  • BrandonQuinn Profile Picture
    7 on at

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

  • BrandonQuinn Profile Picture
    7 on at

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

  • Community Power Platform Member Profile Picture
    on at

    Where would I write this expression. I seem to be having the same problem

  • Oatman2000 Profile Picture
    12 on at

    Hi Paulie, 
    I am having the same issue where the form logic can be skipped based on questions and it's causing my error. 
    "The 'from' property value in the 'select' action inputs is of type 'Null'. The value must be an array."

    Where do I key this into my flow? 

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

    Currently this is mine:
     json(outputs('Get_response_details')?['body/re166e862ac2e43b5a854017b21fe7637'])

     

    Tried this and it still failed:

    if(equals(outputs('Get_response_details'), null), json('[]'), outputs('Get_response_details')?['body/re166e862ac2e43b5a854017b21fe7637'])

  • khari14 Profile Picture
    14 on at

    HI @Paulie78 , I tried to use this syntax for apply to each item but it did not work. Cna you guide me. Below is my flow

     

    Syntax: 

    if(equals(items('Apply_to_each_2')?['DISCHAREGE_x0020_DATE'], null), json('[]'), items('Apply_to_each_2')?['DISCHAREGE_x0020_DATE'])
     
    Error I am facingError I am facing

     

    Syntax of that itemSyntax of that item

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    The expression is doing what it is supposed to do, but you are trying to apply a date conversion to an empty array (so it will not work). It looks like you will probably need a condition at this point to skip this action if the array is empty (or make it supply a hard coded date to get past the error).

  • khari14 Profile Picture
    14 on at

    Yes, you are right but how? I tried both below with no luck

     

    Sol 1:
    coalesce(items('Apply_to_each_2')?['DISCHAREGE_x0020_DATE'],'')
    
    Sol 2:
    if(equals(items('Apply_to_each_2')?['DISCHAREGE_x0020_DATE'], null), json('[]'), items('Apply_to_each_2')?['DISCHAREGE_x0020_DATE'])

     

    Same Error:

    Evaluation of inputs for the expression action of kind 'ConvertTimeZone' failed: 'Required property 'baseTime' expects a value but got null. Path ''.'.

     

    Regards

    Hari

  • Oatman2000 Profile Picture
    12 on at

    2022-07-26_8-03-20.png2022-07-26_8-03-41.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard