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 / can i set() on forall(...
Power Apps
Suggested Answer

can i set() on forall() or not ?

(1) ShareShare
ReportReport
Posted on by 2
hi i'm beginner for powerapp  trying to check condition in toggle input  by forall () in collection that keep toggle input like 
 
UpdateContext({check_result: true});
 
ClearCollect(
    ck_val,[
        {dt: tg_open.Checked},
        {dt: tg_close.Checked},
        {dt: tg_dis.Checked},
        {dt: tg_bt.Checked},
        {dt: tg_fn.Checked},
        {dt: tg_tp.Checked}
    ]
);
 
ForAll(
    ck_val,
    If(
        ThisRecord.dt = false,
        UpdateContext({check_result: false}) // it call cannot invoke on this function 
    )
);

 
Categories:
I have the same question (0)
  • Suggested answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    The ForAll() function is not designed to return results directly in the same way a loop would in a traditional programming language. 
    Specifically, it doesn't allow you to modify the context or variables inside it in the way you're trying to do with. Try the following:
    
    // Initialize the context variable to true first
    UpdateContext({check_result: true});
    
    // Collect all the toggle values into a collection
    ClearCollect(
        ck_val, 
        [
            {dt: tg_open.Checked},
            {dt: tg_close.Checked},
            {dt: tg_dis.Checked},
            {dt: tg_bt.Checked},
            {dt: tg_fn.Checked},
            {dt: tg_tp.Checked}
        ]
    );
    
    // Check if any of the values in the collection are false
    If(
        !IsBlank(LookUp(ck_val, dt = false)),
        UpdateContext({check_result: false})
    )
    
  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at
    Firstly, what @SudeepGhatakNZ has posted will work fine - another shorter version would be to set check_result directly so it will be true if all are checked, otherwise false.
    UpdateContext(
       {
          check_result: 
          tg_open.Checked && tg_close.Checked && tg_dis.Checked && tg_bt.Checked && tg_fn.Checked && tg_tp.Checked
       }
    ) 
     
  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard