Use FetchXml to retrieve data
You can use FetchXml to retrieve data using either the SDK for .NET or Web API. With Power Automate, you can retrieve data using the Web API using the Fetch Xml Query parameter of the List Rows command.
You may also want to use Community tools like the XrmToolbox FetchXmlBuilder
How you retrieve data depends on whether you are using the SDK for .NET or Dataverse Web API.
Use the FetchExpression class to hold the FetchXml query as a string. FetchExpression
is derived from the common QueryBase class type, so you can use it when that type is a method parameter or class property.
You should use the IOrganizationService.RetrieveMultiple method for most cases.
static EntityCollection RetrieveMultipleExample(IOrganizationService service, string fetchXml)
{
return service.RetrieveMultiple(new FetchExpression(fetchXml));
}
You can also use the RetrieveMultipleRequest class with the IOrganizationService.Execute method, but there are few scenarios where this is necessary.
static EntityCollection RetrieveMultipleRequestExample(IOrganizationService service, string fetchXml)
{
var request = new RetrieveMultipleRequest()
{
Query = new FetchExpression(fetchXml)
};
var response = (RetrieveMultipleResponse)service.Execute(request);
return response.EntityCollection;
}
Quickstart: Execute an SDK for .NET request (C#)
Learn more about using messages with the SDK for .NET
Next steps
Learn how to select columns.
Try some sample code
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기