Power Apps With Function
The Microsoft Power Apps With function is a powerful way to divide complex formulas into smaller pieces. It is helpful within a ForAll, since we can’t set variables there. Since the formula is contained, it is preferred over context variables created using UpdateContext or global variables created using Set.
The syntax looks like this:
With(
{
myValue1: //add some logic
},
//Do something with the myValue1 result
)
You can also have nested With functions.
With(
{
myValue1: //add some logic
},
With(
{
myValue2: // do something with myValue1
},
//Do something with myValue2
)
Or even run the With function within a ForAll. You can also run ForEach within the With function itself.
ForAll(galMyItems.AllItems As galSelectedItem,
With(
{
myValue1: //add some logic with galSelectedItem
},
//Do something with the myValue1result
)
)
Subscribe to receive every post in your email inbox.
No spam, no sharing to third party. Only you and me.