cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
oappdev
Advocate V
Advocate V

Display result from Dropdown menu only when value from it is selected

Happy Wednesday!

 

What is the best approach to only show result per Dropdown once selected. Right now when the user select "CatedoryDrp" it automatic populate "SubCategoryDrp","Product Name"

 

Dropdown.PNG

Here is what l'm using now to populate the Dropdown

CatedoryDrp

Distinct('PB Data',Category)

SubCategoryDrp

Distinct(Filter('PB Data',Category=CategoryDrp.Selected.Result),SubCategory)

Product Name

Distinct(Filter('PB Data',SubCategory=SubCategoryDrp.Selected.Result),Concatenate(Item," ",ProductName))

 

I hope i explain correctly

 

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@oappdev 

I think the most straightforward way to do this would be to have a blank cell as the 1st row in 'PB Data' for SubCategoryDrp and ProductName.

 

SubCategoryDrp

Distinct(
    Filter(
        'PB Data',
        IsBlank(Category)=true OR Category=CategoryDrp.Selected.Result
    ),
    SubCategory
)

 

Product Name

Distinct(
    Filter(
        'PB Data',
        IsBlank(SubCategory)=true OR SubCategory=SubCategoryDrp.Selected.Result
    ),
    Concatenate(Item," ",ProductName)
)

 

If the blank value does not appear 1st I believe you could apply a SORT function to make it go to the top!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

10 REPLIES 10
mdevaney
Super User
Super User

@oappdev 

I think the most straightforward way to do this would be to have a blank cell as the 1st row in 'PB Data' for SubCategoryDrp and ProductName.

 

SubCategoryDrp

Distinct(
    Filter(
        'PB Data',
        IsBlank(Category)=true OR Category=CategoryDrp.Selected.Result
    ),
    SubCategory
)

 

Product Name

Distinct(
    Filter(
        'PB Data',
        IsBlank(SubCategory)=true OR SubCategory=SubCategoryDrp.Selected.Result
    ),
    Concatenate(Item," ",ProductName)
)

 

If the blank value does not appear 1st I believe you could apply a SORT function to make it go to the top!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

You rock @mdevaney  Will give it a try and circle back 🤓

@oappdev 

Awesome.  I'm thinking this will work

IsBlank(Category)=true OR Category=CategoryDrp.Selected.Result

 

But in case it shows as a 0 character string instead you could also try this

Category="" OR Category=CategoryDrp.Selected.Result

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thank you so much @mdevaney 

This did the trick

SubCategoryDrp

Distinct(
    Filter(
        'PB Data',
        IsBlank(Category)=true OR Category=CategoryDrp.Selected.Result
    ),
    SubCategory
)

Product Name

Distinct(
    Filter(
        'PB Data',
        IsBlank(SubCategory)=true OR SubCategory=SubCategoryDrp.Selected.Result
    ),
    Concatenate(Item," ",ProductName)
)

 

Can i ask a part 2 question?

@oappdev 

Yes, you can.  I will let you know whether or not I have an idea of the solution.

@mdevaney 

I using the following code that enable the [ ADD ] button. 

DisplayMode

If(IsBlank(SubCategoryDrp.Selected.Result) || IsBlank(ProductNameDrp.Selected.Result), DisplayMode.Disabled,DisplayMode.Edit)

 

But i just want the [ ADD ] to enable when they only select "Product Name" drop-down

i'm using the code

If(IsBlank(ProductNameDrp.Selected.Result),DisplayMode.Disabled,DisplayMode.Edit)

Is giving me an error

 

Disable.PNG

@oappdev 

What is the error message you are receiving here?  I see the warning symbols but not the message.  This will help me to diagnose what is going on.

Happy Thursday @mdevaney 

I fixed it was a "Delegation warning"

 

Trying to figure out why the third drop-down the data is showing without the user selecting the first and second drop-down

 

Code for "Product Name"

Distinct(Filter('PB Data',IsBlank(SubCategory)=true Or SubCategory=drpSubCategory.Selected.Result),Concatenate(Item," ",ProductName))

 

DropDownProductName.PNG

@oappdev 

Delegation was my thought too.  I am glad you were able to solve the problem.

 

Best of luck building your app!

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,502)