cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
larspeterson
Level: Powered On

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
larspeterson
Level: Powered On

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
Community Support Team
Community Support Team

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.
larspeterson
Level: Powered On

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. 

larspeterson
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 284 members 6,557 guests
Please welcome our newest community members: