PowerApps - Back to Basics - With function
With function in PowerApps allow to simplify the complex formulas in to smaller functions. This will enable us to calculate the value or perform the operations as per the requirement. We can pass the Record or reference field names or named vales. Named values will work as variables with in the scope.
Syntax for With,
With
(
<<Record>>,
<<Formula>>
)
Real Time Usage -
One of project, i need to filter the list based on Created Date and Created By user.
Created Date = Today()
Created By = User Logged in to the System.
I have used following formula to achieve the functionality,
With(
{
myList:
Sort(
<<Source List>>,
Created,
Descending
)
},
LookUp(
myList,
Author.Email = User().Email &&
IsToday(Created)
)
)
Here i am using the myList as a named value and filtering the Records based on User and Created Date. I am seeing the value to a Collation and binding this to Gallery to show the records on the User opening the app.
Comments