cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tested1
Helper V
Helper V

Hiding one choice in a drop down column

Hello

 

I have a column called test with a drop down list. I have a sharepoint list for users to fill in to request something.

 

I want to manually put in older requests so one option in column 'test' drop down is 'Legacy'. This is used for all old requests.

 

I want to hide this 'Legacy' choice in the drop down. So: from choice 1, choice 2, legacy it should only show choice 1 and choice 2. Legacy will be hidden

 

Before:             After

Choice 1          Choice 1

Choice 2          Choice 2

Legacy             Blank - Legacy option will be hidden from user)

 

 

Is there any way to hide this one single choice in a drop down column? The items are choices in the powerapps field. so Choices.Listname.Column name

 

Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions

@tested1 

Might also try:

   Filter(Choices(yourDataSource.Brand, !StartsWIth("Legacy"))

 

Just in case there are some "non-space" characters in that space.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

9 REPLIES 9
timl
Super User III
Super User III

Hi @tested1 

You should be able to filter out your Legacy choice by calling the Filter function. The Items property of your drop down control would look like this:

 

Filter(Choices(Listname.Fieldname), Value <> "Legacy")

With SharePoint, the Choices function returns a table with 2 fields - Id and Value. That's the reason why we filter on Value.

 

HI @timl 

 

Thank you for the reply, 

 

Brilliant! I believe it works. Just testing it out now

Hi @timl 

 

For some reason my form is being weird and it has stopped working. I am using look up columns. 

 

So I added the choice 'Legacy (LEG)' to my look up master list, and then refreshed the data source.

 

The legacy (LEG) choice shows when I click new item and select the drop down.

 

I added the formula you said in the Items box on the choices data card. It all accepts but for somereason it does not filter and Legacy (LEG) still shows. Any ideas :)? I put a pic below of what I have. I think the data sources /choices is messing up . very strange.

 

 

image.png

@tested1 

Might also try:

   Filter(Choices(yourDataSource.Brand, !StartsWIth("Legacy"))

 

Just in case there are some "non-space" characters in that space.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Hi @tested1 

This is strange.  In addition to @RandyHayes's suggestion......

 Filter(Choices(yourDataSource.Brand, !StartsWIth("Legacy"))

I would also try to diagnose this by adding a temporary data table onto your screen. If you set the Items property of this to .....

Filter(Choices(Listname.Fieldname), Value <> "Legacy (LEG)")

Does it filter out the "Legacy (LEG)" choice in the data table?

 

 

This is working for one Choice value, but i have to conditionally hide some value from the choice.

The Status-Value "Closed" in my Status-Column "bimStatus" (SharePoint Choice) should only be available when the actual status of the Item is "Solved"

 

bimStatus.Items:

 

If(bimStatus.Value<>"Solved",Filter(Choices([@Incidents].bimStatus),Value<>"Closed"))

 

 

This does not work in Preview and FormMode

 

liniv
Helper II
Helper II

Hello!

I am trying to implement the solution here in my customized form for Sharepoint. It doesn't work, I need some help.

 

I have 2 Choice columns and I want to to the following:

If a value different than "other" is selected in column 1, hide value "Done" from the choices in column to, so it can't be selected.

 

In Items in Column 2 I entered:

If(DataCardValue21.Selected.Value<>"other",Filter(Choices([@DTPs].Workingstatus),Value<>"Done"),Choices([@DTPs].Workingstatus)

 

It looks OK to me, but when I test it, the drop down for column 2 stops working at all. Can someone advise me? Thanks very much in advance

 

KR

 

 

 

SchneidAIR
Advocate III
Advocate III

Try to use the Columns.Value instead of DatacardValueXX.Selected.Value

If(bimStatus.Value<>"Solved",Filter(Choices([@Incidents].bimStatus),Value<>"Closed"))

 

If(Workingstatus.Value<>"other",Filter(Choices([@DTPs].Workingstatus),Value<>"Done"))

SchneidAIR
Advocate III
Advocate III

Try to use the Columns.Value instead of DatacardValueXX.Selected.Value

If(Workingstatus.Value<>"other",Filter(Choices([@DTPs].Workingstatus),Value<>"Done"))

This also could be done in an conditional Matrix Order to Show/hide some Status in Conditional Order.

But then you could no use the  <> / Not() Condition. Instead you have to use a If()-Matrix with inclusion of all relevant Status-Values like this example
bimStatus.Items: 
If(
bimStatus.Value = "Neu",
Filter(
Choices([@Incidents].bimStatus),
Value = "In Bearbeitung" || Value = "Information angefordert" || Value = "Information geliefert" || Value = "Gelöst"
),
bimStatus.Value = "In Bearbeitung",
Filter(
Choices([@Incidents].bimStatus),
Value = "In Bearbeitung" || Value = "Information angefordert" || Value = "Information geliefert" || Value = "Gelöst"
),
bimStatus.Value = "Information geliefert",
Filter(
Choices([@Incidents].bimStatus),
Value = "In Bearbeitung" || Value = "Information angefordert" || Value = "Information geliefert" || Value = "Gelöst"
),
bimStatus.Value = "Information angefordert",
Filter(
Choices([@Incidents].bimStatus),
Value = "In Bearbeitung" || Value = "Information angefordert" || Value = "Information geliefert" || Value = "Gelöst"
),
bimStatus.Value = "Gelöst",
Filter(
Choices([@Incidents].bimStatus),
Value = "Information angefordert" || Value = "Geschlossen"
),
bimStatus.Value = "Geschlossen",
Filter(
Choices([@Incidents].bimStatus),
Value = "In Bearbeitung" || Value = "Information angefordert"
),
Choices([@Incidents].bimStatus)
)
 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (69,443)