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 Apps / About loops in Power Apps
Power Apps
Unanswered

About loops in Power Apps

(0) ShareShare
ReportReport
Posted on by 134

For statement in Java or C language

For(int i = 0; i < 5; i++){
 ....
}

Create a sequentially incrementing number in Power Apps, like the variable used in the code above.
I would like to insert i instead of 1 in 'Index(Choices(Table1.A), 1)'. Is there a way to create i?

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @kjk4563 ,

     

    Please try this

     

    ForAll(Sequence(CountRows(Choices(Table1.A))),Index(Choices(Table1.A), Value))

     

     

    Best Regards,

    Wearsky

  • kjk4563 Profile Picture
    134 on at

    Hi, @v-xiaochen-msft 

    I don't know what the problem is, but an error occurs in the code.
    'Text value is required.'

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @kjk4563 ,

     

    The error message seems to have nothing to do with your initial question.

    Could you share screenshots or formulas?

     

    Best Regards,

    Wearsky

  • VishalJhaveri Profile Picture
    1,167 Moderator on at

    I got this prompt Response.

     

    ForAll(
     [0, 1, 2, 3, 4],
     Label & Text(ThisItem)
    )
  • kjk4563 Profile Picture
    134 on at

    @v-xiaochen-msft 

    ForAll(Sequence(CountRows(Choices(Table1.A))),Index(Choices(Table1.A), Value))

    In this code, I only changed this part of Table1.A.
    Column A in SharePoint is of type Selection.

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @VishalJhaveri ,

     

    Please share more information. To be honest, I'm not quite sure what your need is.

     

    Best Regards,

    Wearsky

  • VishalJhaveri Profile Picture
    1,167 Moderator on at

    This is the ultimate blog you can rely upon.
    PowerApps - ForAll function with examples - Code SharePoint

  • kjk4563 Profile Picture
    134 on at

    @v-xiaochen-msft 

    I used the code you gave me, but an error occurred.
    'Text value is required.'

    We need a way to resolve this error.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard