cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mariominiaci
Frequent Visitor

Multi Select Cascading Dropdowns/Comboboxes via multiple Lists which save correctly

I'm fairly new to Powerapps so apologies if this question has already been answered. I have read many answers and none seem to work for my situation. I have learned the lesson to delete the datacard and re-add the field when I get too confused !

 

My question -

 

In my app I want to create new entries in my main Sharepoint list called Requests. It has several columns and there are 2 particular ones which are Lookups both with multiple entries allowed.

 

The first column is Site and it is a Lookup from a separate Sharepoint list called Sites which itself contains the columns 'Site' and 'Site Description'.

 

The second column is Department and it is a Lookup from a separate Sharepoint list called Departments which itself contains the columns 'Department', 'Department Description' and 'Site'.

 

I do not wish to store the descriptions in the Requests list.

 

I have a first Combobox ddSite which allows multiple sites e.g. 'GB', 'US' and they save correctly to the Sharepoint list. I had set up a combo which showed Site and Site Description successfully but it would not save on Submit or Patch so I have abandoned that for now..

 

The second Combobox is ddDepartment eg 'HR', 'Legal' and this one will only save correctly to Sharepoint if I do not attempt to filter or constrain it. I want to restrict the contents of the ddDepartment choices based on the selected ddSite items (using the Department.Site to link the two I guess). However, whilst I have managed to restrict the contents, the values are not saved into the Request list when I do this.

 

Minimum needed - restricting ddDepartment by the selections in ddSite and have them both save in Sharepoint Requests list. (eg, I choose 'FR' and 'DE' and 'IT' in ddSite, and 'HR' and 'IT' in ddDepartment).

 

I nearly got this apart from the save of ddDepartment:

 

 

 

Filter(Departments As Depts, 
Sum(ForAll(ddSite.SelectedItems, If(ThisRecord.Value in Depts.Site, 1, 0)), Value) > 0)

 

 

This gives me the right list of values but does not save ddDepartment, only ddSite.

 

Ideal - same as the minimum but both ddSite and ddDepartment dropdowns show their descriptions in the app and are searchable too.

 

Thank you in advance!

 

(Edited - I wasn't using any Dropboxes. Current state is I can save if I don't constrain the ddDepartment combo at all)

2 ACCEPTED SOLUTIONS

Accepted Solutions

@mariominiaci 

Very good, then for your Items property of the DataCardValue20, set the formula to:

ForAll(Sites,
    {Id: ID,
     Value: Site
    }
)

Set the DefaultSelectedItems property to: Parent.Default

Set the Update property of the DataCard to: DataCardValue20.Selected

 

For the Departments combobox, set the Items property to:

ForAll(
    Filter(Departments, Site=DataCardValue20.Selected.Value),
    {Id: ID,
     Value: Department
    }
)

Set the DefaultSelectedItems property to: Parent.Default

Set the Update property of that DataCard to: DataCardValue3.Selected

 

You don't need to use Choices as you can just get everything you need from the list itself.  

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

mariominiaci
Frequent Visitor

Update: I have changed the Items formula for DataCardValue3 to:

 

Filter(
    Departments as Depts,
    Sum(
        ForAll(
            DataCardValue20.SelectedItems,
            If(ThisRecord.Value in Depts.Site, 1, 0)),
        Value)
        > 0)

 

and also set the Update on each data card to:

 

DataCardValue3 update: 

ForAll(DataCardValue3.SelectedItems,{Id: ID, Value: Department})

and DataCardValue20 update = DataCardValue20.SelectedItems.

 

Result: all data is being saved. Thank you so much for your help to get this far!

 

(Edited as I had a moment of inspiration for the Update which fixed it - now to test, test, test...)

View solution in original post

12 REPLIES 12

@mariominiaci 

You mentioned both patch and submit...so which are you using?  Are you using a form?  If so, what are the Update properties of the datacards for the fields you are having problems with?  And also, what is the Items property of your dropdown controls (and are they actually dropdowns or comboboxes)?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
mariominiaci
Frequent Visitor

Hi @RandyHayes , I knew I would forget some essential details.

 

I'm using Patch in the following way:

Patch(
    'Requests',
    varFormData,
    Form1.Updates,
    Form1_1.Updates,
    Form2.Updates,
    Form4.Updates,
    Form1_4.Updates,
    {
        Date_Raised: Now(),
        Requestor_Name: User().FullName,
        Requestor_Email: User().Email
    }
);

 My app is split across multiple screens and all the forms refer back to varFormData.

 

Update properties are:

ddSite card: DataCardValue20.SelectedItems <-- the name of the actual dropdown control.

ddDepartment card: DataCardValue3.SelectedItems<-- the name of the actual dropdown control.

 

Items of the dropdowns (they are dropdowns now as the comboboxes weren't saving for me):

ddSite = Choices([@'Requests'].Site)

ddDepartment = Choices([@'Requests'].Department) <--- I have removed all my attempts to filter it down, as the app has to save data.

@mariominiaci 

Yes, so first, you should not split forms with that method.  Using a patch across your forms will break features and functionality of the forms...which really kind of wastes the whole purpose of forms!

If you want to learn how to split forms properly and not break the form, then please review this video on the topic.

 

There is quite a bit of confusion I am having on your scenario - you mentioned the Update properties are referencing the controls of DataCardValue20 and DataCardValue3, but you are also indicating that the dropdowns are called ddSite and ddDepartment.  So the update is not referencing the right controls. 

Also, your Update properties reference the SelectedItems property of the other controls...dropdowns will not have a SelectedItems property!

 

As for your dropdowns in general...the Items properties are correct for the most part.  I realize you want to actually have the department list only show the departments related to the site selections.  We'll cover that once you have something working to start with.

 

So, if you could clarify some of the above...that would be helpful!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
mariominiaci
Frequent Visitor

Thank you for the video link, I will review it today.

 

The columns in the Requests list are called Site and Department, and I have renamed the cards (which contain error, star, dropdown and key) to ddSite and ddDepartment in the tree of my app. Inside of ddSite there is a dropdown called DataCardValue20 and inside of ddDepartment there is a dropdown called DataCardValue3. I hope that is a bit clearer.

 

I have undone the Filter/Sum from my original post as, whilst it was allowing me to pick the values with restrictions, it wasn't saving and I didn't fully understand the logic so I want to avoid extra risk.

@mariominiaci 

Okay...a little clearer.  But, there is ONE part that is glaring out at me.  If you truly have a DropDown called DataCardValue20, then you should have an error on the Update where you have DataCardValue20.SelectedItems as Dropdown controls do NOT have selected Items.

Also, the fact that you refer to ddSite.SelectedItems (in your original post) is very confusing because you are stating that ddSite is a datacard (which would not have a selectedItems property) and you are stating that it is not a combobox (DataCardValue20), it is a dropdown (which again, would not have a selectedItems property)

 

Very confused on what you currently have, so finding it hard to provide the next steps for you to help resolve.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
mariominiaci
Frequent Visitor

Apologies for the confusion, I can assure you I am at least as confused. They are in fact both comboboxes and not dropdowns - it's been a long day! 😅

 

It's probably best to ignore the code snip in the original post as I have unwound that change and can no longer recreate the behaviour of 'limiting and selecting departments ok but not saving to the Requests list'. I think I had that in the DefaultSelectedItems, but it's now royally ignoring me and showing all the Departments anyway (which does not make sense data wise).

 

I have watched your video about Patching in the interim (thanks) and will implement those changes. I had followed a method which duplicated the form and cut away the different parts but I like the idea of using SubmitForm instead so will try and add it carefully without breaking more stuff...

 

Additional - I've seen some solutions using concatenation of values but I'm not sure if they are still current so I've stayed away from trying them. I really want to understand what I'm doing to maintain it. I have another similar case which requires one final value only (i.e. cascade of comboboxes which filter down to one value) and it works fine, but I am still getting my head around collections.

@mariominiaci 

No problem.  I understand that starting out things can get a little confusing pretty quickly!

 

Don't waste your time on collections!!  They are way overused in examples and not needed unless you have a need to have all of your data in-memory and the ability to then add/remove/update records in the in-memory table.  In your case (so far) there is no need for them.

 

The next big thing to keep in mind is...keep it simple!!  Most of what you are trying to do, PowerApps will do for you.  The problem (especially being new to it), is that you don't yet know how and where it will do that, so you proceed to try and make it all work on your own...and that just complicates things!

 

But, since we shuffled around a bit of confusion in the prior posts, I want to get clear on your scenario now.

Please clarify to following and correct as needed:

- You have a Combobox called DataCardValue20 in a datacard called ddSite

- You have a Combobox called DataCardValue3 in a datacard called ddDepartment

- The underlying column for ddSite is a column (most likely called) Site.  That column is a Lookup column. 

- The underlying column for ddDepartment is a column (most likely called) Departement. That column is a Lookup column.

 

If the above is correct so far, then What is the name of the list that the Site lookup is set to?  And, what is the name of the list that the Department lookup is set to?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Your clarifications are correct:

 

- You have a Combobox called DataCardValue20 in a datacard called ddSite

- You have a Combobox called DataCardValue3 in a datacard called ddDepartment

- The underlying column for ddSite is a column called Site.  That column is a Lookup column. The list for the Lookup is called Sites which itself contains the columns 'Site' and 'Site Description'.

- The underlying column for ddDepartment is a column called Department. That column is a Lookup column. The list for the Lookup is called Departments which itself contains the columns 'Department', 'Department Description' and 'Site'.

mariominiaci
Frequent Visitor

I've managed to get some progress using the following, but it only lets me pick the Departments for the last Site in DataCardValue20, not for all of them. The Department saves successfully at least.

 

Filter(Choices([@'Requests'].Department),
    Value in Filter(
        Departments,
        Site in DataCardValue20.Selected.Value
    ).Department
)

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (880)