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 Apps / Iteration inside ForAll
Power Apps
Unanswered

Iteration inside ForAll

(0) ShareShare
ReportReport
Posted on by 21

Hello PowerApps fam,

 

Hoping to get some help here, I am trying to iterate through a collection inside a ForAll. This is what I have so far:

ClearCollect(samptable, {}); // Initialize the collection

With({x: 30 * 2.71828^(-0.0006 * Value(y))}, // y is a label with a number text

ForAll(Sequence(4),

   Collect(

      sampletable,

         {

            Iteration: Value,

            Result: round(x, 0)

         }

)))

I want the Value(y) to increase by the result for each iteration. As an example:

initial value of z = 600

samptable collection should show the following table:

Iteration / Result

1 / 21

2 / 21

3 / 20

4 / 20

 

Thank you in advance

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi @Harold_ 

     

    Try this,

     

    ClearCollect(samptable, {}); // Initialize the collection

    With(
    {x: 30 * 2.71828^(-0.0006 * Value(y))},
    ForAll(
    Sequence(4),
    Collect(
    samptable,
    {
    Iteration: Value,
    Result: Round(x, 0)
    }
    );
    UpdateContext({y: Sum(samptable, Result)})
    )
    )

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • Harold_ Profile Picture
    21 on at

    @Rajkumar_404, I tried this before. Both Set and UpdateContext functions cannot be invoked within ForAll function

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard