Hi Community!
I am creating two SharePoint lists that are connected to a PowerApps application. The SP List1 "TripsList" shows all the trips a person can choose, and the SP List2 "Destinations", shows all the destination a person might be within a trip.
The relationship is one to many since one person might be in more than one destination during the same trip. For this, I created a column named "Identifier" which connects both lists. In the SP List1 the "Identifier" will be used only once, however, in the SP List2, it might be used more than once.
Both lists have a column named "Trip Status" with the following options: Cancelled, Postponed, In Process and Completed. The end-user must select the trip status in each destination in the SP List2.
I would like to create a rule to gather the general "Trip Status" of each trip in SP List1, based on the trip status the end-user select in the SP List2.
For example, if all the destinations in SP List2 for the identifier 1111 are marked as Completed, then the "Trip Status" on the SP List1 for the identifier 1111 must be Completed as well.
Any suggestion is much appreciated!
Thank you in advance 🙂
Hi @vsolanon ,
Do you want to remove the Delegation warning issue from your formula?
Firstly, the Delegation warning issue is not an error, it just means that you could not delegate the data process to your data source itself, instead, you could only process data locally within your app.
In default, you could only process 500 records locally within your app, you could consider change the "Data row limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings of your app, then you could process 2000 records locally at most in your app.
Currently, the CountRows function is not a delegable function in SP List data source, so your Delegation issue is related to this function. More details about delegable functions supported in SharePoint, please check the following article:
If the amount of your data source records ('Destinations List') is not more than 2000, you could ignore this warning issue. If the amount of your data source records is more than 2000, you could consider bulk-load your data source records into collection in your app, then use the collection as data source in your app instead of the original 'Destinations List'.
Please check and see if the following solution could help in your scenario:
Best regards,
Hi @vsolanon ,
Do you save the changes you made within the Gallery2 Item via clicking the "Edit" button?
If you save the changes you made within the Gallery2 Item via clicking the "Edit" button, please add the following formula within the OnSelect property of the "Edit" button:
Parch(....); // Update current item in your Gallery2
// Add the following formula
If(
// Third Rule
CountRows(Filter('Destinations List', 'Trip Status'.Value = "Postponed" && Identifier = ThisItem.Identifier))>=1 && CountRows(Filter('Destinations List', 'Trip Status'.Value = "In Process" && Identifier = ThisItem.Identifier))=0,
Patch(
'TripsList',
LookUp('TripsList', Identifier = ThisItem.Identifier),
{
'Trip Status': {
Value: "Postponed"
}
}
),
// Second Rule
CountRows(Filter('Destinations List', 'Trip Status'.Value = "In Process" && Identifier = ThisItem.Identifier))>=1,
Patch(
'TripsList',
LookUp('TripsList', Identifier = ThisItem.Identifier),
{
'Trip Status': {
Value: "In Process"
}
}
),
// First Rule
CountRows(Distinct(Filter('Destinations List', Identifier = ThisItem.Identifier),'Trip Status'.Value))=1,
Patch(
'TripsList',
LookUp('TripsList', Identifier = ThisItem.Identifier),
{
'Trip Status': {
Value: First(Distinct(Filter('Destinations List', Identifier = ThisItem.Identifier),'Trip Status'.Value)).Result
}
}
)
);
Please take a try with above formula, then check if the issue is solved.
Best regards,
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473