cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jdrussell78
Level: Powered On

Help with arrays (i think)

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

1 ACCEPTED SOLUTION

Accepted Solutions
jdrussell78
Level: Powered On

Re: Help with arrays (i think)

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

View solution in original post

10 REPLIES 10
Dual Super User
Dual Super User

Re: Help with arrays (i think)

@jdrussell78 

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!





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





jdrussell78
Level: Powered On

Re: Help with arrays (i think)

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
Dual Super User
Dual Super User

Re: Help with arrays (i think)

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!





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





jdrussell78
Level: Powered On

Re: Help with arrays (i think)

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

Dual Super User
Dual Super User

Re: Help with arrays (i think)

@jdrussell78 

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





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





jdrussell78
Level: Powered On

Re: Help with arrays (i think)

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

 

 

jdrussell78
Level: Powered On

Re: Help with arrays (i think)

if we go with the coalesce example.

 

Where would I use that function ?

Highlighted
Dual Super User
Dual Super User

Re: Help with arrays (i think)

@jdrussell78 

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!





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





jdrussell78
Level: Powered On

Re: Help with arrays (i think)

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

View solution in original post

jdrussell78
Level: Powered On

Re: Help with arrays (i think)

thanks a lot for your help !

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,406)