dynamics-crmazure-data-factoryfetchxml

Loading Data from Dynamics CRM to SQL Server


Not able to get optionset string from Dynamics CRM to SQL Server using Azure data factory.

I am using Azure data factory to move data from Dynamics CRM to SQL DB. I used fetchXML query to get the data from source (CRM). I am able to get normal string and guid type values without any issue.

But the optionset field from CRM is coming as Int32 type (ie, I am getting the value of optionset, not the string).

How can I fix this issue?


Solution

  • I'm going to have to sync the stringmaps entity too as I exceeded the link-entity limit for a given FetchXML query.

    The following will bring in the textual value of an OptionSet selection.

        <link-entity name="stringmap" from="attributevalue" to="____" visible="false" link-type="outer" alias="____">
            <filter type="and">
                <condition attribute="objecttypecode" operator="eq" value="___"/>
            </filter>
            <attribute name="value"/>
        </link-entity>
    

    to should be the name of the OptionSet column on the host/root entity

    alias whatever you want to call the column in the output. I used the same value as to

    value This is the object type code for your host/root entity. It is an integer value.