Apologies if this is posted in the wrong forum, new to the community and finding my way around.
The company I work for is starting to use Dynamics CRM and I'm building the process for loading the data through to our on premise DWH. They are planning to use Business Process Flows for key processes, but looking at the tables for each business process flows they field names aren't user friendly for reporting. Looking in dbo.workflow I can see the descriptive information for each field is held in the xaml field:
I'm attempting pull out the bits highlighted in green e.g. ControlDisplayName="Advisory Appointment Booked?" ControlId="igl_advisoryappointmentbookedboolean"
I've been able to do something similar with dbo.annotations to pull out notes related to an incident, e.g.
SELECT objectid_entitytype, objectid, REPLACE(REPLACE(CONVERT(VARCHAR(1000),CONVERT(XML,notetext).query('/div/div')),'<div>',''),'</div>','') AS [Note as VARCHAR], notetext FROM annotation
but attempting the same with the workflow.xaml field is just returning an empty string so far.
SELECT Id, name, uniquename, xaml, CONVERT(XML,xaml).query('/Activty/mxswa.ActivityReference.TypeArguments/Activity/sco.Collection.TypeArguments/Activity/Sequence/mcwb.ControlControlDisplayName') FROM workflow
I assume I'm missing some nodes from the xml query, but not sure what. Has anyone been able to do this before or know of anywhere else in the database where this isnt stored as an xml varchar.
Cheers