I would like to know how to use ForAll() function inside another ForAll().
Inside ForAll() function, we can use ThisRecord property to retrieve selected record values.
It seems to be allowed to nest second level ForAll() function, but when we do it, ThisRecord property retrieve only last ForAll() level. So, my questions are
- Is it really allowed to nest ForAll() function?
- how to retrieve first level ForAll() values inside second ForAll() level?
If it is not allowed to nest ForAll() function, which formula (or tips) should be used to deliver same result? (meaning Loop insinde another loop)
Solved! Go to Solution.
Keep in mind that a ForAll is not a For/Loop. A ForAll is a function that returns a table based on iterations over another table. So, if you are looking to do what you are doing to try and make a ForAll into a ForLoop, your challenges are ahead with the concept of a for/loop inside of a for/loop because again...ForAll is a table function. Can they be nested...sure, if you need a table within a table, it is perfectly fine.
As for referring to tables - PowerApps as has As statement that can be used to provide a named reference to your table (i.e. the ForAll).
As for ThisRecord - ThisRecord refers to the closes table operation function. So, ThisRecord inside of a ForAll refers to the current iteration record of the ForAll. If you have, let's say, a Filter inside of the ForAll to Filter another table to include in your table record of the ForAll, then ThisRecord inside of the Filter would refer to the Filter record. Best to use the As statement to be clear on what you are referring to.
I hope this is helpful for you.
Sounds good. If you get stuck, feel free to post back your formula and I'd be happy to troubleshoot and correct it.
Check out new user group experience and if you are a leader please create your group
Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.