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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help with arrays (i th...
Power Automate
Answered

Help with arrays (i think)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have a form that is letting people add items that they want to buy, one at a time.  At any point there can be 1 or more items.

 

In my flow, the prices are calculated, by initialising and setting the variables.

 

However, if I have less than 5 variable set my flow fails.

 

I think I need to use an Array, but I am unsure.

 

My flow looks like thisflow.JPG

Categories:
  • efialttes Profile Picture
    14,756 on at

    @Anonymous 

    Can you share the details of the expressions you use in your "set variable"'s?

    Also, if they come from the Microsoft Forms responsas, can you share details on the Form itself?

    Thanx!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    So the set variable looks like this

     

    mul(int(body('Get_response_details')?['r01dd8cab3c154b5186fb8e3c692f85e8']),float(body('Get_response_details')?['rb2441aaaef334619b92d5e838a688338']))
     
    And that comes from the form
  • efialttes Profile Picture
    14,756 on at

    Hi again

    According to the official documentation, funcion int() expects a string, so... can you share an example of

    body('Get_response_details')?['r01dd8cab3c154b5186fb8e3c692f85e8']

    as it is displayed on the Get REsponse Details output?

    Thanx!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Sure, thanks for your assistance.

     

    "r01dd8cab3c154b5186fb8e3c692f85e8": "2",


    The Flow works if all variables are set, its only when not all five are set that it fails

  • efialttes Profile Picture
    14,756 on at

    @Anonymous 

    What are your requirements when not all five variables are set?

     

    I mean, you can for example try to use coalesce() function to set a variable with a default value in case the corresponding response could not be obtained from the form response

    Hope this helps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I see what you mean, but I don't think that will work as it will populate the subsequent email with default info

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    if we go with the coalesce example.

     

    Where would I use that function ?

  • efialttes Profile Picture
    14,756 on at

    @Anonymous 

    I need more details about what you are trying to build, can yo detail what expressions you to set the value in each variable, what field in the survey is optional and which one is mandatory, and which requirements you have in order to write the content of the email in case any of the fields in this survey has no response

    Thankx!

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think I have fixed this, I have now got a condition based on whether a customer answered yes to add another line (variable2 etc) and if they didn't it just stops at that point.

     

    It looks massive, but it will work

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    thanks a lot for your help !

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard