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

Display a dropdown only if items are available

Hello together,

 

I've got a question regarding AllowedValues-Fields:

I have an AllowedValues-Dropdown. It has the Items Property "Filter('Streams & Products'; Product = DataCardValue5.Selected.Result)" which allows me to show the respective Roles for a Product.

Sometimes there are no special roles for a product so in that case, I want to hide my dropdown field. How can I do this?

I tried IsEmpty(DataCardValue5.Items) and I tried IsEmpty('Special Role_DataCard2'.AllowedValues)

[Special Role_DataCard2 is the respective DataCard to my dropdown]

Has anyone of you don this before or has an idea how to do it?

 

TL;DR: How can I hide a dropdown-field when it has no items to select?

 

Thanks for your support 🙂

 

Moritz

1 ACCEPTED SOLUTION

Accepted Solutions
gmaasz Helper III
Helper III

Re: Display a dropdown only if items are available

I did something similar by taking the values you want in the dropdown and adding it to a variable beforehand. THen use IfBlank and IsEmpty for the variable to make the visible property either true or false. 

 

Worked fine for me.

View solution in original post

3 REPLIES 3
gmaasz Helper III
Helper III

Re: Display a dropdown only if items are available

I did something similar by taking the values you want in the dropdown and adding it to a variable beforehand. THen use IfBlank and IsEmpty for the variable to make the visible property either true or false. 

 

Worked fine for me.

View solution in original post

MKWIN
Frequent Visitor

Re: Display a dropdown only if items are available

Okay, how exactly did you do it? Did you add the Filter(...)-formula to a variable or how exactly did you do it?

gmaasz Helper III
Helper III

Re: Display a dropdown only if items are available

I use a previously selected dropdown's onchange property with the following code:

Set(ListOfAssemblies;Filter(Var1;Column.Value=Var2).Title)

So you  can filter the collection/list/table and insert the output into a variable

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,871)