Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 7HUDc03TsIw4OTyPgsj4yW
Power Apps - Building Power Apps
Unanswered

Filter dropdown based on other dropdown selected value

Like (0) ShareShare
ReportReport
Posted on 5 Sep 2023 05:17:33 by 559

Hi All,

 

I have a gallery where there are two dropdowns (Phase and Work product). Work product should filter dropdown values based on the Phase selected. For E.g. If Phase selected values is "Onboarding" then the Work Product should have values only as (Code, Product, CAR Report). The Work Product values will not have only 3 constant value always. It might add more values in the future. And If CAR Report is selected for one row in the gallery it must omit that option and show the rest two values in the dropdown for the next row. E.g. If(1st row has CAR Report, then the second row should display only Code, Product in the Work Product Dropdown). These two criteria must satisfy for the Work Product Dropdown.

Any help/suggestion on this.

Thanks in advance.

Categories:
  • Sri Profile Picture
    559 on 05 Sep 2023 at 11:27:35
    Re: Filter dropdown based on other dropdown selected value

    @v-qiaqi-msft 

    If(dropdown_Phase.Selected.Phase=Label5.Text,
    Filter(
    Work_Product_Master,
    PhaseNames = Phaseglrdropdown.Selected.Phase
    ).'Work Product/Process',
    dropdown_Phase.Selected.Phase=Label5.Text&&!IsBlank(LookUp(DataSourceForGallery,WorkProduct=Label6.Text)),
    Filter(
    Work_Product_Master,
    !IsBlank ('Work Product/Process')&&'Work Product/Process'<>Label6.Text
    ).'Work Product/Process'
    )

    The already selected choice is not getting omitted for the second time. I have attached the screenshot for the same. When the Product is already selected it still show the Product value in the dropdown for the next row. 

     

  • Sri Profile Picture
    559 on 05 Sep 2023 at 09:21:04
    Re: Filter dropdown based on other dropdown selected value

    @v-qiaqi-msft 

    I have attached screenshot of how the gallery look like. When the Project name and the Practice displayed above based on that the gallery loads with the Phase values. The Phase dropdown will not be the same for all the Projects. Based on the project name the Phase dropdown values also varies. For e.g. for the Project Demo July the Phase values will be Onboarding, design and for the another project this Onboarding value will not be there. So I cannot manually give the values for Phase too as how you gave above.

  • v-qiaqi@microsoft.com Profile Picture
    on 05 Sep 2023 at 09:11:09
    Re: Filter dropdown based on other dropdown selected value

    Hi @Uthhra,

    Not sure how you filter phase based on project name selected, I just give you an example based on the Sort() function on Phase dropdown.

    If(dropdown_Phase.Selected.Phase="Onboarding",
    Filter(
    Work_Product_Master,
    !IsBlank ('Work Product/Process')
    ).'Work Product/Process',
    dropdown_Phase.Selected.Phase="Onboarding"&&!IsBlank(LookUp(DataSourceForGallery,WorkProduct="CAR Report")),
    Filter(
    Work_Product_Master,
    !IsBlank ('Work Product/Process')&&'Work Product/Process'<>"CAR Report"
    ).'Work Product/Process'
    )

    Note that DataSourceForGallery is the data source you populate the Gallery with.

  • Sri Profile Picture
    559 on 05 Sep 2023 at 08:59:34
    Re: Filter dropdown based on other dropdown selected value

    @v-qiaqi-msft 

    Phase and Work Product column type is Single line of text in SharePoint. I have added a Dropdown for both on the screen and gave the items property of the Dropdown based on the Project name selected in the gallery.

    The items property of the Phase is:

    Sort(
    Phase names,
    Phase
    )

    This Phase names comes from another list called Phase master which filter the values in Phase dropdown based on the Project name selected. And for the Work Product the items property which I have given as of now is:

    Filter(
    Work_Product_Master,
    !IsBlank ('Work Product/Process')
    ).'Work Product/Process'

    which filter the Work Product values in dropdown from a list called Work Product Master.

     

  • v-qiaqi@microsoft.com Profile Picture
    on 05 Sep 2023 at 08:35:00
    Re: Filter dropdown based on other dropdown selected value

    Hi @Uthhra,

    Please do answer my question:

    vqiaqimsft_0-1693902831056.png

     

    I hard code this because you don't tell me how you set the Items property of phase dropdown and I don't know column type either.

     

  • Sri Profile Picture
    559 on 05 Sep 2023 at 06:35:36
    Re: Filter dropdown based on other dropdown selected value

    @v-qiaqi-msft 

    And we cannot give dropdown values manually. The values of the Work product can change in the future. So it has to be filtered directly from the SharePoint list based on the Phase selected. 

  • Sri Profile Picture
    559 on 05 Sep 2023 at 06:31:59
    Re: Filter dropdown based on other dropdown selected value

    @v-qiaqi-msft ,

    Phase is also a dropdown which collects value from a list called Phase master. Both Phase and Work product dropdown has two different list. If the Phase has some other values other than "Onboarding" it has to load the remaining Work product dropdown other than the three values for Onboarding.

  • v-qiaqi@microsoft.com Profile Picture
    on 05 Sep 2023 at 06:26:19
    Re: Filter dropdown based on other dropdown selected value

    Hi @Uthhra,

    Could you please tell me thaht how you set the Items property of dropdown Phase?

    What is the column type of Phase and Work product?

     

    Generally, we could hard code the Work product dropdown based on dropdown Phase selected.

    If(dropdown_Phase.Selected.Phase="Onboarding",["Code", "Product", "CAR Report"],dropdown_Phase.Selected.Phase="Onboarding"&&!IsBlank(LookUp(DataSource,WorkProduct="")),["Code", "Product"])

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard