web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

I want to fetch CDS entity data of a particular view and store it in CSV file

(0) ShareShare
ReportReport
Posted on by 65

Suppose I have my Account Entity which is a default entity and I want to fetch data from any of its view(i.e. My Active Accounts or All Accounts etc.) which names I will pass as an input in Flow and I want to store this data in a CSV file. How can I achieve it?
@Paulie78 @RezaDorrani 

I have the same question (0)
  • ChrisPiasecki Profile Picture
    6,414 Most Valuable Professional on at
    Re: I want to fetch CDS entity data of a particular view and store it in CSV file

    Hi @Tourist,

     

    You can achieve this by querying the Views table, which will contain the FetchXML definition that can be passed into a following List Records action against your table (e.g. Account). Example below:

     

    In your List Rows action, specify that you just need the fetchxml column, then filter by the view name parameter.

    ChrisPiasecki_1-1624748310508.png

     

    To avoid an apply to each action, you can use the first expression to get the only item from the list rows action, and the fetchxml value, passing that into the FetchXML parameter.

     

    ChrisPiasecki_2-1624748487168.png

    Expression: first(outputs('List_rows_-_Get_View')?['body/value'])?['fetchxml']

     

    Finally, you can use the Create CSV Table action, where you can either use all the columns from the output, or manually pick which columns you want in the CSV. Then you can use the OneDrive or SharePoint connector to create a file in a folder, using the CSV output as the content.

    ChrisPiasecki_3-1624749080941.png

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • Tourist Profile Picture
    65 on at
    Re: I want to fetch CDS entity data of a particular view and store it in CSV file

    Hi @ChrisPiasecki, the List rows action which you are applying on Accounts table gives me all columns even if I write the column names and apart from that there is one more issue the lookup and dropdown columns gives me a lot of fields like lookuplogicalname, Odata.type etc. which is not something I want, I want only text values which comes in formattedValue field.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard