cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

Incrementing a variable in a ForAll()

This is some code that is creating a collection

 

Set(
    Counter,
    0
);
ClearCollect(
    statusTable,
    'OneEng Candidates'.GeneralStatus
);
Collect(
    sortedTable,
    ""
);
Clear(sortedTable);
ForAll(
    statusTable,
    Collect(
        sortedTable,
        {
            status: ThisRecord.GeneralStatus,
            number: Counter+1
        }
    )
)

 

 

The collection looks like:

 

Screen Shot 2020-07-28 at 10.48.49 AM.png

However I want the counter to go up by 1 every time. Is there a way to increment the counter within the ForAll Loop in the above context? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Post Prodigy
Post Prodigy

I don't have the answer for you, but I just ran into this video this morning and it seems it probably covers exactly what you are wanting to do.

 

https://youtu.be/oKJkVx2gehw

View solution in original post

1 REPLY 1
Highlighted
Post Prodigy
Post Prodigy

I don't have the answer for you, but I just ran into this video this morning and it seems it probably covers exactly what you are wanting to do.

 

https://youtu.be/oKJkVx2gehw

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,999)