Export data service list into a excel sheeet

Hello i have a list in data service that i want to export into a excel sheet then clear the data service list. ANy idea on how to perfrom this ?

Hi @langsem, you can accomplish this via a process that uses the Data Service activities.

To export data to an excel sheet, you will need to:

  1. Build a data table with the fields you’d like to capture from the entity
  2. Use the query entity records activity to get the list of records that you’d like to export from Data Service
    Note: If you have more than 1000 records, you will need to implement logic for pagination
  3. For each record in this list, create a Data Row and add it to the Data Table created in step 1.
  4. Finally, write the Data Table to the Excel file using the Write Range activity

To delete records from an Entity in Data Service, you will need to:

  1. Use the query entity records activity to get the list of records that you’d like to delete from Data Service
  2. Iterate through the list of records and create a list of record ids (of type System.Guid) for the records that need to be deleted
  3. Use the delete multiple records activity to delete records

what do you mean in step 3 ? I cant assign the item in for each to the add data row action. Shouldent i use an assign activity for each element ?

@langsem - that’s right. For each record in the list, you will need to use the multiple assign activity to populate the data in the data row, and then add it to the data table.

Also here’s an example project that illustrates both download to Excel and Delete.
Download to Excel and Delete example.zip (22.9 KB)
This example saves the Name and Nations data from the Olympics entity from the example here: Using Entities in Projects

Made that one work, the issue now its to delete the data in data service. Its complaining about the data type System.Guid. But cant use it as System.Guid

Hi @langsem, the example project in my previous reply also includes an example of how to delete data from Data Service.

To delete data, you will need to iterate through each record in the list resulting from the query activity, and add the Id property of each item to a collection of type System.Guid. Finally, you can use the Delete Multiple Records activity and provide it this list of Guids to delete records.
Here’s a screenshot of the steps to delete records using the activity from the example project

1 Like

Hello @Karan, the XAML that you uploaded here, shows some error(“The activity is missing”) after I downloaded it, can you help me with a new XAML.

Hi @Dimple_Mandal, have you imported the Data Service Activities Pack into our project?
If not, you can add it from Manage Packages → Official and searching for Data Service