cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
allyseh
Helper I
Helper I

Switching from CDS connector to Dynamics 365 connector - field type errors

I previously configured several canvas apps embedded in dynamics 365 forms, using the CDS - current environment connector.

Each app contains a form connecting to data from a child entity. Due to licensing issues, we are having to at least temporarily change back to using the dynamics connector, and I'm running into a lot of issues with it. Most of my fields that should be displayed as combo boxes are coming across as text fields with string types, and I can't find a way to access the list of options that should be displayed. 

 

My 'Contact Type' field using the CDS connector: 

 

optionSet.PNG

 

How the field looks using the dynamics connector:

 

stringType.PNG

 

Looking at the field under Data - Entities (make.powerapps.com) :

 

entityData.PNG

 

How the field is configured in D365:

 

crmField.PNG

 

I don't have much experience with the dynamics connector, and I'm really confused at how the field is getting converted to a string type, while it is clearly shown as an option set everywhere else. We need to be able to go live with our solutions soon, and any help on how to reconfigure these forms would be really appreciated!

5 REPLIES 5
PaulD1
Community Champion
Community Champion

With the D365 connector I believe the string value will be the code of the option. You can see this if you go into the entity in CDS, click on the attribute with the option set and then click 'View More' beside the option.

image.png

When you are working with a reference to another entity, the string will be the GUID of the record.

@PaulD1 , 

 

The numbers make more sense now, thank you. Is there still a way to access the full list of options for the field? We really need for our users to be able to select one of the options, and then the rest of the cards on the form are shown or hidden based on that. With the CDS connector we were given a combo box for the option set. Is there a way to get that with the Dynamics connector? Thank you!

PaulD1
Community Champion
Community Champion

I don't know of a way with the Dynamics connector of getting the option set list.

When using the Dynamics connector, we resorted to creating our own collections (in the App OnStart event) that were the equivalent of the Option Sets (obviously there is then the problem that if you change the Option Set, the App must be manually updated).

@PaulD1 ,

 

I created collections in my app's onStart, and now I can see and select the correct lists of values for each combo box, and I've been able to save single values back to the CRM Contact Ext records. If I open up a Contact Ext record, I see the correct updated values, but when I refresh the form with the embedded app, all the combo box fields are reset with blank values. I'm having some trouble setting the defaults to read in the correct values from the CRM record. The card's default property wants an optionset value, and I'm not exactly sure how to get that. 

 

Here's a list from one combo box:           travelTypeList.PNG

 

I've set the control's OnChange and Default values like this:

onChange.PNG

 

controlDefault.PNG

 

I'm getting this error with the card's default property:     optionsetValueIssue.PNG

(right now it's set to ThisItem.'Travel Contact Type')

 

Am I on the right track or is there a better way to do all of this? Any suggestions would be really helpful. Thank you!

PaulD1
Community Champion
Community Champion

Sorry for delayed reply,

When you build your local collection it needs to contain both the text of the option and the underlying number (usually somethin like 6810100 - no idea why numbers in this range are used), then when you are patching back to the datasource, use the numeric value.

Equally when setting the defaults, use the numeric code of the option set, not the text label.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,669)