cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Multiple choice column options to look up options from another list and filterable in a gallery

I have a gallery in which I want to show assets based on a selected room on an organization's campus.

 

In my SP List named "Asset List", I have a column with the name of the asset, (let's call it "Desktop PC") and then a multiple choice column for the rooms it's available in. I want for that multiple choice column's options to be looked up in another SP List called "Room Lists". This avoids having to list every single room as a multiple choice option after having already listed it in "Room Lists" and also keeps both up to date in one go. (I know this is probably impossible though, so it's not a total issue).

 

The next option which is most important is for the gallery to be able to match a dropdown list of the campus' rooms (called campusRoomList) and pull up any assets who's multiple choice column has that room ticked on "Asset List".

This is what I have on the gallery Items:

Filter ('Asset List', Room.Value = campusRoomList.Selected.Title)

This works on single choice columns, but as soon as I make it multiple choice, it refuses to convert the choices to strings and compare.

For example, if I have one Desktop PC in each of the rooms C3.01 to C3.05, I want to be able to list the asset ONCE on the SP list and then on the multiple choice column tick all rooms from C3.01 to C3.05. Then in the app, when the dropdown list selects one of those rooms, say C3.02, the gallery will display any items that are located in C3.02 - in this case, Desktop PC and any others).

 

If this doesn't work, I will have to make hundreds of rows alone just for "Desktop PC" so that there's one for each room - and that's just one of 10-20 assets per room. This is a prone to false data entries by those populating the Asset List and will also pass the 2000 item filter limit, which can be reduced to about 20 items with the method I'm proposing.

 

Hopefully this is possible - thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Amik
Super User
Super User

Hi @aantoniou ,

 

As I understand it, you have a SharePoint list called Asset List. This list contains a multi-choice column, but you'd prefer it was a multi choice Lookup column to another column in a separate SharePoint list called Rooms List.

 

In your App, you have a single select Dropdown control called campusRoomList. You want to set the Items property of that Dropdown control to your Multi Choice Lookup column, and then Filter a Gallery to display any items which contain the selected value in your Dropdown control.

 

1. Create a multi-choice Lookup column in SharePoint and ensure you have enabled multiple selections.

 

Amik_0-1691009122168.png

 

2. In your Dropdown control, enter the following in the Items property:

 

Choices([@'Asset List'].'Your multi choice lookup field')

 

 

3. Apply the below to the Items property of the Gallery:

 

Filter(
    'Asset List',
    Len(campusRoomList.Selected.Value) = 0 || campusRoomList.Selected.Value exactin Concat(
        'Your multi choice lookup field',
        ThisRecord.Value & ","
    )
)

 

 

------------------------------------------------------------------------------------------------------------------------------

 

If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

 

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

View solution in original post

11 REPLIES 11
Amik
Super User
Super User

Hi @aantoniou ,

 

As I understand it, you have a SharePoint list called Asset List. This list contains a multi-choice column, but you'd prefer it was a multi choice Lookup column to another column in a separate SharePoint list called Rooms List.

 

In your App, you have a single select Dropdown control called campusRoomList. You want to set the Items property of that Dropdown control to your Multi Choice Lookup column, and then Filter a Gallery to display any items which contain the selected value in your Dropdown control.

 

1. Create a multi-choice Lookup column in SharePoint and ensure you have enabled multiple selections.

 

Amik_0-1691009122168.png

 

2. In your Dropdown control, enter the following in the Items property:

 

Choices([@'Asset List'].'Your multi choice lookup field')

 

 

3. Apply the below to the Items property of the Gallery:

 

Filter(
    'Asset List',
    Len(campusRoomList.Selected.Value) = 0 || campusRoomList.Selected.Value exactin Concat(
        'Your multi choice lookup field',
        ThisRecord.Value & ","
    )
)

 

 

------------------------------------------------------------------------------------------------------------------------------

 

If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

 

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hi @Amik 

Thanks for your response, I hadn't thought of going with the LookUp option and allowing multiple choices so that works so far, however I've come across another issue when I try to make the name of the source List dynamic.

 

It is failing to fetch the image of the asset from the image column (which I've tried as both hyperlink and as an uploaded image).

I had to make some slight changes to determine which asset list to choose from, as I have multiple depending on each building. (I'm trying as much as possible to avoid the 2000 row limit).

As soon as I change 'Asset List' from your code to If statements like this:

Filter(
If(buildingList.Selected.Title = "Campus 1", 'Campus 1 Asset List',
If(buildingList.Selected.Title = "Campus 2", 'Campus 2 Asset List'
)
),
Len(campusRoomList.Selected.Value) = 0 || campusRoomList.Selected.Value exactin Concat(Room, ThisRecord.Value & ",")

 It doesn't allow the image in the gallery to be set to assetImage which is the column in the Asset List.

ThisItem.assetImage

It says 'assetImage' isn't recognized.

 

This would all be solved if I could have the entire app filter through multiple data sources at once without setting conditions based on the results of dropdown lists. In some instances, some campuses have as many as 10 buildings and I don't think nesting 10 If statements is practical for the optimization of the app. I have multiple dropdown lists each cascading the next, going from Campus>Building>Room which leads to the gallery. Hope this makes sense.

Amik
Super User
Super User

@aantoniou assuming the schema is the same across all lists, particularly the logical name of the assetImage field, I cannot think of any reason the Asset Image would not be recognized.

 

On a separate note, consider using Switch as opposed to nested ifs. E.g.:

 

Filter(
    Switch(
        buildingList.Selected.Title,
        "Campus 1",
        'Campus 1 Asset List',
        "Campus 2",
        'Campus 2 Asset List',
        "Campus 3",
        'Campus 3 Asset List',
        "Campus 4",
        'Campus 4 Asset List',
        "Campus 5",
        'Campus 5 Asset List',
        "Campus 6",
        'Campus 6 Asset List',
        "Campus 7",
        'Campus 7 Asset List',
        "Campus 8",
        'Campus 8 Asset List'
    ),
    Len(campusRoomList.Selected.Value) = 0 || campusRoomList.Selected.Value exactin Concat(
        Room,
        ThisRecord.Value & ","
    )
)

 

 

------------------------------------------------------------------------------------------------------------------------------

 

If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hi @Amik,

Thanks again, that works like a charm.
I was wondering if you know how this can be altered to have a combo box filter through a gallery? The client has requested that they can not only filter by room, but also filter by services to see the rooms instead. I've made a multiple choice lookup column in the Room List to write each room's functionality, e.g. Lecture Capture, Hybrid teaching, Live Streaming etc.

 

When I use this with a combo box, it seems to filter each combo box item individually - e.g. I want it to filter rooms that have Lecture Capture && Hybrid Teaching, not Lecture Capture || Hybrid Teaching. It's currently returning rooms for the latter. Keep in mind this is for a lot more than just 2 options. Thanks!

Filter('Room List',
Len(requirementList.Selected.Title) = 0 || requirementList.Selected.Title exactin
Concat(
Capability,
ThisRecord.Value & ","
)
)

 

Amik
Super User
Super User

Hi @aantoniou - I think what you're trying to say is that you want to Filter a multi-choice SharePoint Choice field with a multi-select Combo Box (a many-to-many filter). If that is correct then you can use the non-delegable example below: 

 

If(
    CountRows(requirementList.SelectedItems) = 0 || IsEmpty(requirementList.SelectedItems),
    'Room List',
    Ungroup(
        ForAll(
            requirementList.SelectedItems As _selecteditem,
            Filter(
                'Room List',
                _selecteditem.Value in Capability.Value
            )
        ),
        "Value"
    )
)

 

------------------------------------------------------------------------------------------------------------------------------

 

If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

 

 

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hi @Amik,

That works but seems to be returning a room multiple times if it fits the criteria in more than one occasion. For example, if room 2.12 fits both option A and B, it will show room 2.12 twice in the gallery. I did have to change _selectedItem.Value to _selectedItem.Title.

Thanks,

 

Anastasios

Amik
Super User
Super User

@aantoniou my fault, try the revision below:

 

If(
    CountRows(requirementList.SelectedItems) = 0 || IsEmpty(crequirementList.SelectedItems),
    'Room List',
    //exclude blank rows from appearing in the Gallery for any selected choice which has not yet been entered in the data source
    Filter(
        ForAll(
        //exclude duplicates on many-to-many filters
            Distinct(
                Ungroup(
                    ForAll(
                        requirementList.SelectedItems As _selecteditem,
                        Filter(
                            'Room List',
                            _selecteditem.Value in Capability.Value
                        )
                    ),
                    "Value"
                ),
                ThisRecord
            ),
            Value
        ),
        Len(ID) > 0
    )
)

 

------------------------------------------------------------------------------------------------------------------------------

 

If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

Hi @Amik,

Apologies, it seems this is doing what the original issue was which is returning all possibilities and not exact matches to all choices.

Thanks again,

 

Anastasios

Amik
Super User
Super User

Hi @aantoniou - not sure I understand. Could you share a screenshot? 

 

The above code will return all matches which exist in based on the selected choices.

 


------------------------------------------------------------------------------------------------------------------------------


If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan

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 (1,360)