Hi everyone, I have this SharePoint list full of date values called 'Queue', and am storing the list into a collection called 'EarliestAval'. After that I store the latest date from each unique 'Title' value into a variable as shown in the code. I refer to these variables in another location in order to tell the user the earliest they can reserve a spot.
Refresh('Queue');
ClearCollect(EarliestAval,'Queue');
Set(Date1,First(Filter(EarliestAval,'Date Out'=First(Sort(Distinct(EarliestAval,'Date Out'),Result,Ascending)).Result,Title = "1").'Date Out').'Date Out');
Set(DateRB,First(Filter(EarliestAval, 'Date Out'=First(Sort(Distinct(EarliestAval,'Date Out'),Result,Ascending)).Result,Title = "Reference Bay").'Date Out').'Date Out');
Set(DateSL,First(Filter(EarliestAval,'Date Out'=First(Sort(Distinct(EarliestAval,'Date Out'),Result,Ascending)).Result,Title = "Service Lane").'Date Out').'Date Out');
Set(Date2,First(Filter(EarliestAval,Title = "2", 'Date Out'=First(Sort(Distinct(EarliestAval,'Date Out'),Result,Ascending)).Result).'Date Out').'Date Out');
All of this code seems identical, however only the variable 'Date1' actually stores info successfully, with all other variables being blank even if there is a match in the sharepoint list/collection. Help would be greatly appreciated.
Solved! Go to Solution.
With({_items: Sort(Queue, 'Date Out')},
Set(Date1, LookUp(_items, Title="1").'Date Out');
Set(DateRB, LookUp(_items, Title="Reference Bay").'Date Out');
Set(DateSL, LookUp(_items, Title = "Service Lane").'Date Out');
Set(Date2, LookUp(_items, Title = "2").'Date Out')
)
You have a lot of redundant and heavy-data interactive functions in that formula.
Please consider changing your Formula to the following:
With({_items: Sort(Queue, 'Date Out'),
Set(Date1, LookUp(_items, Title="1").'Date Out');
Set(DateRB, LookUp(_items, Title="Reference Bay").'Date Out');
Set(DateSL, LookUp(_items, Title = "Service Lane").'Date Out');
Set(Date2, LookUp(_items, Title = "2").'Date Out')
)
I hope this is helpful for you.
When I paste it in, I get the following error
With({_items: Sort(Queue, 'Date Out')},
Set(Date1, LookUp(_items, Title="1").'Date Out');
Set(DateRB, LookUp(_items, Title="Reference Bay").'Date Out');
Set(DateSL, LookUp(_items, Title = "Service Lane").'Date Out');
Set(Date2, LookUp(_items, Title = "2").'Date Out')
)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
51 | |
47 | |
32 | |
32 |
User | Count |
---|---|
258 | |
89 | |
78 | |
67 | |
67 |