cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Smarty_
Helper II
Helper II

How to make a [for (int i = 0; i < max); i++)] construction?

Hello, colleagues!

 

I'm trying to make a loop, where "i" (counter) will be an integer variable.

 

So, I've initialized a variable (max_anount_of_rangs):

Smarty__0-1634305542262.png

Created "Apply for each" action:

Smarty__1-1634305612876.png

 

And I have an error:

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@variables('max_amount_of_rangs')' is of type 'Integer'. The result must be a valid array.

 

Is it possible somehow to do this action without an array?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Super User
Super User

Hi @Smarty_ 

 

You can do this in 1 action. A select. The input is range(0,i)

then in the select, choose text mode and insert your object with item().

 

Damien

Please consider accepting my answer as a solution if it helps to solve your problem.

Cheers
Damien

Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

View solution in original post

1 REPLY 1
DamoBird365
Super User
Super User

Hi @Smarty_ 

 

You can do this in 1 action. A select. The input is range(0,i)

then in the select, choose text mode and insert your object with item().

 

Damien

Please consider accepting my answer as a solution if it helps to solve your problem.

Cheers
Damien

Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (1,781)