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 / collection, forall: ho...
Power Apps
Unanswered

collection, forall: how process item based on property of previous item

(0) ShareShare
ReportReport
Posted on by 704

Hi,

 

When showing an item of a collection in a gallery I want to only show a label if a text property of the item differs from the same property of the previous one.

I thought I
add a column: showlabel
do a forall and compare the text propery against a string variable: if different showlable:true else showlabel:false

if different also store the text property to the string variable for comparing the next item

and then set label visible property to showlabel in the end

 

Alas for some reason I cannot store anything into variable inside a forall. UpdateContext and Set are forbidden.

So how then?

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

    Hi @HansHeintz ,

    Yes, it's not supported to use UpdateContext and Set function in ForAll function currently, because they could easily be used to hold variables that would be susceptible to this effect.

    Here's a doc about ForAll function for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-forall

    Please modify your formula.

    If you still have any problem, please show me your formulas.

    This will help me understand better.

     

     

  • HansHeintz Profile Picture
    704 on at
    “would be susceptible to this effect”
    What effect are you talking about?

    I have no code to evaluate because i do not know how to approach this problem. That was my question.
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @HansHeintz ,

    Inside ForAll function, you need to avoid ordering dependencies.

    You could refer the doc that I listed for details.

    To sum up, within PowerApps, UpdateContext function is not supported to used within the ForAll function.

    I suggest you consider put he UpdateContext function outside the ForAll function.

    For example, 

    UpdateContext({var:ForAll(.....)})

     

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard