Thursday, November 12, 2020

Power Query - Acesso CRM Dynamics ODATA

Exemplo 1 :

 let

    Source = OData.Feed("https://priocrm.crm4.dynamics.com/XRMServices/2011/OrganizationData.svc", null, [Implementation="2.0"]),

    #"Filtered Rows" = Table.SelectRows(Source, each ([Name] = "ActivityPointerSet")),

    ActivityPointerSet_table = #"Filtered Rows"{[Name="ActivityPointerSet",Signature="table"]}[Data],

  #"Removed Other Columns" = Table.SelectColumns(ActivityPointerSet_table, {"CreatedOn", "Description", "ActivityId", "Subject", "ActivityTypeCode", "ModifiedOn", "ModifiedBy", "RegardingObjectId"}),

  #"Expanded regardingobjectid_lead" = Table.ExpandRecordColumn(#"Removed Other Columns", "RegardingObjectId", {"LeadId"}, {"LeadId"}),

  #"Expanded modifiedby" = Table.ExpandRecordColumn(#"Expanded regardingobjectid_lead", "ModifiedBy", {"Fullname"}, {"Fullname"}),

    #"Filtered Rows1" = Table.SelectRows(#"Expanded modifiedby", each [LeadId] <> null and [LeadId] <> "")

in

  #"Filtered Rows1"

============================================================

/*

let

    Source = OData.Feed("https://priocrm.crm4.dynamics.com/XRMServices/2011/OrganizationData.svc", null, [Implementation="2.0"]),

    Source = OData.Feed("https://priocrm.crm4.dynamics.com/api/data/v8.1/", null, [Implementation="2.0"]),

    Source = OData.Feed("https://priocrm.crm4.dynamics.com/api/data/v9.1/", null, [Implementation="2.0"]),

    Source = PowerBI.Dataflows(null),

    VworkspaceId = Source{[workspaceId="4534543543543543256-ef1f382aaf76"]}[Data],

    VdataflowId = VworkspaceId{[dataflowId="3453454359de2-11f4805d6615"]}[Data],

    FAT_Table = VdataflowId{[entity="FAT_CRM_DGEG_activitypointers"]}[Data]

in

    FAT_Table 

*/

============================================================


OBS: Para aceder via ODATA , sera necessario ter acesso de leitura as entidades do Dynamics!!!!

No comments:

Post a Comment

Power Query - funcao limpa replace texto numero

//fnc_limpa_texto (TextValue as nullable text) => let     SafeText = if TextValue = null then "" else TextValue,     DigitsOnly...