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:
- Build a data table with the fields you’d like to capture from the entity
- 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
- For each record in this list, create a Data Row and add it to the Data Table created in step 1.
- 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:
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