How do I convert a dataverse table object to a json string using FetchXML

zmsoft 280 Reputation points
2025-01-07T08:13:12.31+00:00

Hi there,

In synapse pipeline, I want to convert a dataverse table object to a json string using FetchXML.

Whether FetchXML can achieve this function? Any suggestion?

Thanks&Regards,

zmsoft

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,148 questions
{count} votes

Accepted answer
  1. Chandra Boorla 7,260 Reputation points Microsoft Vendor
    2025-01-07T19:19:45.71+00:00

    Hi @zmsoft

    Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!

    FetchXML is a proprietary query language used in Microsoft Dataverse to retrieve data. While FetchXML is primarily designed for querying data, it does not directly convert data into JSON format. Instead, you would typically retrieve the data using FetchXML and then convert the resulting data into JSON format in your application or pipeline.

    In a Synapse pipeline, use a Web activity to call the Dataverse Web API with your FetchXML query. This will retrieve the data. The API response will be JSON, but in a specific structure. You'll then need to process this response. Use a Data Flow (for visual transformation) or a Script activity (for more complex logic with languages like Python) to transform the API response into the exact JSON structure you need. This gives you full control over the final JSON output.

    This structured approach will help you effectively convert a Dataverse table object to a JSON string in your Synapse pipeline.

    For more detailed implementation, you may want to refer to the below documentation on how to use FetchXML with the SDK for .NET or the Dataverse Web API.

    Use FetchXml to retrieve data

    I hope this information helps. Please do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.