Skip to main content
Community site session details
Power Apps - Building Power Apps
Answered

Create dependency between two dropdowns within two different SharePoint list

Like (0) ShareShare
ReportReport
Posted on 4 Mar 2020 12:34:00 by 146

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 🙂

 

 

  • Verified answer
    v-xida-msft Profile Picture
    on 09 Mar 2020 at 01:57:13
    Re: Create dependency between two dropdowns within two different SharePoint list

    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:

    https://docs.microsoft.com/en-us/connectors/sharepointonline/#power-apps-delegable-functions-and-operations-for-sharepoint

     

    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:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Loading-60-000-SharePoint-List-Items/m-p/448633/highlight/false#M133427

    https://powerusers.microsoft.com/t5/General-Discussion/Pulling-in-large-ish-SQL-tables/m-p/243777#M71518

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Sort-gallery-with-multiple-fields/td-p/379730

    https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Delegation-Formula-Help/m-p/394039#M115089

     

    Best regards,

  • Verified answer
    v-xida-msft Profile Picture
    on 06 Mar 2020 at 04:31:20
    Re: Create dependency between two dropdowns within two different SharePoint list

    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,

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473