web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set variable in a ForA...
Power Apps
Unanswered

Set variable in a ForAll fuction

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

I want to use the code below in a ForAll function then change DataCardValue28_2.Text with ThisRecord.'Wafer ID'.Text.  

 

Set(RCACount,Sum(ForAll(Filter(RCAData, BatchID = DataCardValue16_2.Text && WaferID = DataCardValue28_2.Text),1),Value));

 

I know a cannot Set a variable within a ForAll function, but I cannot figure out a workaround for the above example. There will be up to 25 different possibilities in the collection.

 

Thank you in advance.

 

Rob

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @rob4681 

     

    try this please:

    Clear(TempCollection);
    
    Collect(
     TempCollection,
     ForAll(
     RCAData,
     If(
     BatchID = DataCardValue16_2.Text && WaferID = ThisRecord.'Wafer ID'.Text,
     {Value: 1} // Adjust the value as necessary
     )
     )
    );
    
    Set(RCACount, Sum(TempCollection, Value));

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard