web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding Filter Items to...
Power Apps
Answered

Adding Filter Items to combobox from sharepointlist

(0) ShareShare
ReportReport
Posted on by 58

I'm stuck with adding choices to a choicebox. If i'm making a choice in the first choicebox, the second choicebox must be filled with only the items that have the selected characteristic.

I'm having 3 lists.

First list is called Campus, Second list is called 'gebouw' (in English Building), Thirth list is called 'lokaal' (in English called Room).

The logic behind it is: Every campus has it own set of buildings and every building has it own set of rooms. Lists are linked by the 'lookup' option in sharepoint list.

I've added as datasources to the three lists mentioned above.

When I choice ‘Vildersstraat’ only the rooms located at ‘Vildersstraat need to be added to ‘lokaal’.

timdehaen_0-1698562286047.png

 

I’ve written this code (don’t mind the ; In using an AZERTY keyboard so I need to replace , by ; )

    AddColumns(

        Choices([@Helpdesk].lokaal) As _Choices;

        "lokaalhelpdesk";

        LookUp(

            [@Lokalen];

            'Id (ID)' = _Choices.Id

        ).Campus

    );

    lokaalhelpdesk.Id = DataCardValueCampus.Selected.Id

)

 

What I'm I doing wrong?

Categories:
  • timdehaen Profile Picture
    58 on at

    The whole databasestructure. That maybe makes it more obvious. 

  • Nilsnutz Profile Picture
    36 on at

    Based on your datastructure it looks like you have a direct lookup from room to campus (not room -> building -> campus)
    Unless I'm missing something you should be able to filter the second combobox for rooms like this:
    Filter(rooms,
    CampusLookupColumn.Id = campusselector.Selected.ID)

     

    If you don't have the direct lookup room -> campus, I would clearcollect all buildings in that campus in the onchange property of the campus combobox and filter the room list like:

    Filter(rooms,
    buildingLookUp.Id in col_CollectedBuildings.ID)

  • timdehaen Profile Picture
    58 on at

    Table "Helpdesk" wasn't yet added tot de dbstructurechart. 

  • timdehaen Profile Picture
    58 on at

    I've solved the problem by doing a Lookup in a Lookup clause. 

  • Verified answer
    timdehaen Profile Picture
    58 on at

    Set(Campusnaam;LookUp(
    [@Lokalen];
    'Officieel lokaal nr' = Lokaal.Selected.Value
    ).Campus.Value
    );;

  • timdehaen Profile Picture
    58 on at

    timdehaen_0-1699165119775.png

    In the onchange i've added the code above (and a Lookup for the e-mailaddress of the helpdesk)

     

    timdehaen_1-1699165200510.png

    Code of the lookup for the helpdeskaddress

     

    Set(Helpdeskadres;
    LookUp(
    [@Campussen];
    'Id (ID)'= LookUp(
    [@Lokalen];
    'Officieel lokaal nr' = Lokaal.Selected.Value
    ).Campus.Id).Helpdeskmail
    );;

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard