cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

CDS Picklist Dropdown Allow Blanks and Show Blank if No Value

I have a form that shows the item selected in a gallery. One of the fields is a custom picklist dropdown (High, Moderate, Low). Currently, all the items in the CDS have no value for this field. However, when I load an item into the form it defaults to "High". I would prefer it show a blank and I would like a blank option in the dropdown. Is this possible or do I have to hack my way into making this work? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: CDS Picklist Dropdown Allow Blanks and Show Blank if No Value

For any that are curious, my solution has been to create a new Entity called Lists. This entity consists of a description field and then a boolean field for each picklist I want to create. I have allowed blank values for the description field and my first entry in the entity is a blank description field with all boolean values set to true, so it will be in every dropdown.

 

For instance, in the standard Product entity I created a relationship to lists and named it Quality. Then, in my form I delete the lookup dropdown and input a custom dropdown with ProductForm.Items = Filter(Lists, HighModLow = true)


Here is the an excerpt of the Lists table I am referring to:

 

Primary ID 

Description

 HighModLow

000001

 

True 

000002 

high 

True 

000003 

moderate 

True 

000004 

low 

True 

 

I hate hacks, but it is better than not being able to accomplish what I need!

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: CDS Picklist Dropdown Allow Blanks and Show Blank if No Value

Hi larspeterson,

 

What do you mean by “all the items in the CDS have no value for this field”? I am not sure with this sentence.


I create several Picklist columns in a custom entity, then create an app based on it.
Both on Edit Form and Display Form, there are default values for each Picklist column.
So it might be not possible to show blank option in the dropdown.

 

A screenshot of my app, on the Edit screen, all the Picklist columns are showing their default value.

1.png

 


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advocate II
Advocate II

Re: CDS Picklist Dropdown Allow Blanks and Show Blank if No Value

Thanks for your efforts. What I mean by “all the items in the CDS have no value for this field” is that, in the Common Data Service, there are no values in the picklist field for each record. In other words, each record actually has no value for that field. In other words, even though the record has no entry, when I pull the record into the form, it shows up as if "high" were selected.


I wanted to see if I got any easy answer, but I suspect this is not supported yet. I am instead going to create a collection with each picklist and add a blank value, then set the items for the dropdown to the created collection. This is not an ideal solution as I have to manually recreate the picklist and if I ever change the picklist, I will have to update the app. Any other ideas? I can't find a way to collect a picklist. 

Highlighted
Advocate II
Advocate II

Re: CDS Picklist Dropdown Allow Blanks and Show Blank if No Value

For any that are curious, my solution has been to create a new Entity called Lists. This entity consists of a description field and then a boolean field for each picklist I want to create. I have allowed blank values for the description field and my first entry in the entity is a blank description field with all boolean values set to true, so it will be in every dropdown.

 

For instance, in the standard Product entity I created a relationship to lists and named it Quality. Then, in my form I delete the lookup dropdown and input a custom dropdown with ProductForm.Items = Filter(Lists, HighModLow = true)


Here is the an excerpt of the Lists table I am referring to:

 

Primary ID 

Description

 HighModLow

000001

 

True 

000002 

high 

True 

000003 

moderate 

True 

000004 

low 

True 

 

I hate hacks, but it is better than not being able to accomplish what I need!

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,280)