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 / Multiple ForAll(Sequen...
Power Apps
Answered

Multiple ForAll(Sequence) events within Collect or ClearCollect function

(0) ShareShare
ReportReport
Posted on by 179

Hello, Folks

 

Is there a way to make this syntax work within a ClearCollect, or Collect function? 

ClearCollect(colLocationList, 
ForAll(Sequence(16), {LSD_Values:Text(Value)}), 
ForAll(Sequence(36), {SEC_Values:Text(Value)}),
ForAll(Sequence(126), {TWP_Values:Text(Value)})
);

I'm trying to  collect multiple columns of different sequenced values in one function... This syntax is accepted but only the first column returns values when executed: 

SequenceCollection.PNG

Any thoughts?

 

Thanks!

Categories:
I have the same question (0)
  • LeeB_CDN Profile Picture
    179 on at

    Ok, upon further evaluation it looks like the function IS collecting each sequence, but instead of starting at the first row in the collection (for each new column), it is adding the preceding sequence number of empty values into that corresponding column... so SEC_Values column has 16 blank fields before the (36) number sequence starts.. That is unexpected behavior...  Any ideas?  

  • Verified answer
    cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Hmmm, this should work? 

     

    ClearCollect(
    colLocationList,
    ForAll(
    Sequence(126),
    If(
    Value <= 16,
    {
    LSD_Values: Text(Value),
    SEC_Values: Text(Value),
    TWP_Values: Text(Value)
    },
    If(
    Value <= 36,
    {
    LSD_Values: Text(Value),
    SEC_Values: Text(Value),
    TWP_Values: Text(Value)
    },
    {
    LSD_Values: Text(Value),
    SEC_Values: Text(Value),
    TWP_Values: Text(Value)
    }
    )
    )
    )
    )

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Ops, I mean this 😛 

     

    ClearCollect(
    colLocationList,
    ForAll(
    Sequence(126),
    If(
    Value <= 16,
    {
    LSD_Values: Text(Value),
    SEC_Values: Text(Value),
    TWP_Values: Text(Value)
    },
    If(
    Value <= 36,
    {

    SEC_Values: Text(Value),
    TWP_Values: Text(Value)
    },
    {

    TWP_Values: Text(Value)
    }
    )
    )
    )
    )

  • LeeB_CDN Profile Picture
    179 on at

    Brilliant @cwebb365 ... Wrapping my brain around this Powerapp syntax is crazy, I appreciate your approach, it worked exceptionally! 

     

    Can you think of a way for me to add "0"'s to the TWP_Values record so that double digit #'s would show a single "0" preceding the value, and single digit #'s would show "00" preceding the value?  

  • LeeB_CDN Profile Picture
    179 on at

    Haha... woops I think I jumped the gun... First solution just listed all numbers in each column (to 126) 

    Second solution only showed first set of numbers and didn't add the other columns!.. 

  • Verified answer
    cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    My Bad, Use this one as the answer. I messed up the edit's, first one did all numbers, just needed blanks in there instead if you haven't figured that out already, here is working code. 

    ClearCollect(
    colLocationList,
    ForAll(
    Sequence(126),
    If(
    Value <= 16,
    {
    LSD_Values: Text(Value),
    SEC_Values: Text(Value),
    TWP_Values: Text(Value)
    },
    If(
    Value <= 36,
    {
    LSD_Values: "",
    SEC_Values: Text(Value),
    TWP_Values: Text(Value)
    },
    {
    LSD_Values: "",
    SEC_Values: "",
    TWP_Values: Text(Value)
    }
    )
    )
    )
    )

     

     

    As for the 0's gonna be something in the Text() function I think can handle that let me fiddle. 

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Ok so for the 0's, use Text(Value,"0#") for the TWP Values. You can do leading 0's, only need it for the first IF statement since after the first group you won't need it in the rest. 

  • LeeB_CDN Profile Picture
    179 on at

    Yes @cwebb365 !! You did it! Thank you so much! That allowed me to filter and add the zeros where required. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard