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

facing issue with Option Sets in CDS on CANVAS APP EDIT FORM

Hi,  

 

I am developing Canvas app on CDS. I have option sets on entities, so when I create Edit Form in Canvas app, PowerAPPs automatically adds mandatory fields on the form. The option sets which are mandatory do not display the options in option sets. It displays a text field instead. But If that option set is not mandatory in CDS,  canvas app EDIT form displays all the values in drop down with no Issue. 

 

So to confirm this,

I changed a mandatory option set to Non Mandatory and created a new Edit form. This time on edit form the option set displayed all the options in drop down.

Then  I changed back that option set to non mandatory and then created a new edit form, I faced the same issue.

 

I tried this for both Edit and New form modes Behavior is same.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

@AdnanKhan 

Do you have anything turned off in Advanced Settings, other than Experimental features?

Annotation 2019-12-13 095730.png

View solution in original post

Hi,

Thanks @SeanHenderson , for pointing me into the right direction.

 

and Thank you @mcolbert @v-siky-msft  @mike528 for help and suggestions :).

 

 

I enable below option and it resolved the issue.adding option.PNG

View solution in original post

9 REPLIES 9
mike528
Resolver II
Resolver II

@AdnanKhan 

 

Do you have a question in how to fix this? If you need to have the dropdown on non-mandatory fields, simply delete the text input control in the data card and replace with a dropdown and use the Choices() expression with the name of the option set for that field.

 

Hope this helps.

SeanHenderson
Impactful Individual
Impactful Individual

@AdnanKhan 

I am unable to recreate your issue. I built a CDS entity called DemoNames and included a mandatory Option Set field called OptSetTest.

When I add a new Edit Form, it just shows up with the primary field (Name) and Created On. I add the OptSetTest field from the fields menu and it shows up properly as a dropdown.

Annotation 2019-12-12 160509.png

Can I please see a screenshot of your entity in CDS, with the option set field that is acting up?

 

@SeanHenderson 

1. This is my entity and field which is required in CDS

 

CDS Image 1.PNG

 

 

2. I have selected a blank screen in Canvas and then inserted Edit form in it.

adding new blank screen.PNG

 

 

3. Selected source(CDS) and entity

 

3 connect data.PNG4 chose entity.PNG

 

 

4. Mandatory fields automatically added on the form. In image below it has a text field Site Type Value. which is a text field type and mandatory. 

5 another field with same name different type.PNG

 

5. And also in above snapshot you can see when I open Add fields again I see another field SIte Type. Which is of type Option Set and If I add this on the form it displays all the drop down options. When I save the form it doesnt allow me unless I put numeric value in the Site Type Value text field.

 

 

last one.PNG

@mike528 

 

"use the Choices() expression with the name of the option set for that field."

By above you mean to set Drop Down control Items property with my option set field in  Choices

as shown in snapshot below?

 

choices as optionsets.PNG

Hi @AdnanKhan ,

 

I also follow your steps, but my required option set field works as a combo box in the form properly, I can't reproduce your issue.

Snipaste_2019-12-13_11-29-57.png

What about replacing textinput box to combo box and setting Items property: Choices([@Site].'Site Type')?

Best regards,

Sik

 

@AdnanKhan 

 

Yes, the exact name for your option set will come up with intellisense. This typically depends on if it's a global optionset or tied specifically to that entity field.

Hope this helps,

 

Mike

@AdnanKhan 

Do you have anything turned off in Advanced Settings, other than Experimental features?

Annotation 2019-12-13 095730.png

View solution in original post

 

 

 

@SeanHenderson 

Below are the advanced settings 

 

advanced settings 1.PNGadvanced settings 2.PNG

 

 

Hi,

Thanks @SeanHenderson , for pointing me into the right direction.

 

and Thank you @mcolbert @v-siky-msft  @mike528 for help and suggestions :).

 

 

I enable below option and it resolved the issue.adding option.PNG

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,116)