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

Unable to save values in Option Set (CDS)

Hi everyone,

I'm trying to create a canvas application based on Dynamics 365. At first, I had trouble relating records between them (1-to-many relationship) but I've been able to get this worked by using Common Data Service as the data source instead of using Dynamics 365 as the data source (more information here : https://powerusers.microsoft.com/t5/General-Discussion/Relate-serveral-records-to-an-other-selected-...).

 

But now, the contents of dropdowns (global option set in Dynamics) isn't saved when I submit the form (screenshot below).

Before (canvas using Dynamics 365 as the data source), the two dropdowns referring to option sets were configured as follows:
'Industry Label_Datacard1'.Default = ThisItem.'Industry Label'
'Industry Label_Datacard1'.DataField = "_mso_industry_label"

DataCardValue59.Items = Parent.AllowedValues
DataCardValue59.Default = Parent.Default
This configuration doesn't work anymore (on canvas using Common Data Service as the data source) : no information is displayed in the dropdown.
So, I tried the following changes :
'Industry Label_Datacard1'.Default = ThisItem.Industry
'Industry Label_Datacard1'.DataField = "_mso_industry_label"

DataCardValue59.Items = Choices('Sous-rapports_1'.mso_industry)
DataCardValue59.Default = Parent.Default
dropdowns content is correctly displayed but the selected value isn't saved when the form is submitted.

After reading many posts on this forum (in particular :
https://powerusers.microsoft.com/t5/General-Discussion/Unable-to-Patch-CDS-entity-option-set-value-f... ), I tried to use the Patch function but in vain. Exemple of what I tried : 
On Submit button : 

Icon3_6.OnSelect = SubmitForm(Form_Subreport);;
Patch('Sous-rapports_1'; Form_Subreport.LastSubmit; {'Industry': DataCardValue59.Selected.Value)
(I'm not sure using Patch function is nessary.)
 

Do you have an idea to solve my problem? 

 

P.S. : I hope to have been clear. As you have probably noticed, English isn't my native language. Smiley Wink

 

Screenshot :

Capture12.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
F4b
Level: Powered On

Re: Unable to save values in Option Set (CDS)

Hi @v-xida-msft  and @Rebetcha,

I had already tried with Choices(Industry) but an error was displayed.

 

However, I've been able to solve my issue : I recreated the option sets and configure data card value with "Choices('Sous-rapports_1'.mso_industry)". It worked !


I think the issue came from the change of data source (Dynamics 365 to CDS).

 

Thanks a lot for your help !

 

PS : Actual configuration of the Data Card Value :
Capture15.PNG

View solution in original post

4 REPLIES 4
Rebetcha
Level 10

Re: Unable to save values in Option Set (CDS)

Hi @F4b ,

In the configuration you shared I miss what you have in the Update property of Industry Label_DataCard1.

That is the property that determines what is saved to the datasource. 

That should be DataCardValue59.selected.

 

Can you check if this is the case?

F4b
Level: Powered On

Re: Unable to save values in Option Set (CDS)

Hi @Rebetcha ,

 

On my configuration, I have : 

Industry Label_DataCard1.Update = DataCardValue59.Selected.Value

"Value" is the only attribute I can choose.

When it's DataCardValue59.selected, an error message appears: Text value expected.

 

Thank you for your help.


PS : More information : 

Capture13.PNGCapture14.PNG

 

Highlighted
Community Support Team
Community Support Team

Re: Unable to save values in Option Set (CDS)

Hi @F4b ,

Is the Industry a Option Set Type column in your CDS Entity?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please consider set the Items property of the Industry ComboBox to following:

Choices(Industry)

Set the Update property of the Industry data card to following:

DataCardValue59.Selected.Value

If the issue still exists, please consider re-generate a new app based on your CDS Entity, then try it again, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
F4b
Level: Powered On

Re: Unable to save values in Option Set (CDS)

Hi @v-xida-msft  and @Rebetcha,

I had already tried with Choices(Industry) but an error was displayed.

 

However, I've been able to solve my issue : I recreated the option sets and configure data card value with "Choices('Sous-rapports_1'.mso_industry)". It worked !


I think the issue came from the change of data source (Dynamics 365 to CDS).

 

Thanks a lot for your help !

 

PS : Actual configuration of the Data Card Value :
Capture15.PNG

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: 335 members 5,421 guests
Please welcome our newest community members: