I am happy to announce that we have released a new set of activities that allow you to create, update or delete multiple records in a single activity call.
You will need to update your Data Service activities pack to version 21.1.2 to get these new activities. With the release, we have introduced three new activities -
These new activities accept and return a List<T> of entity records as input and output, compared to a single record as input and output for our standard create, update or delete activities. You can read more details about them on our activities help page - Data Service Studio Activities
These activities can accept up to 1000 records in a single call and each activity call will count as one call against your service usage quota.
Give them a try and let us know how you like them!
Can someone give an example on how to use the batch activities, all the videos can find is using a for each activity which I would assume wouldn’t be the case if it’s a batch upload.
The examples typically include For Each activity to iterate through the list of their records in either a data table or excel or other source, and a populate a list of type List(Of <entityType>) variable. Once you have the list variable, it can be passed to Batch activities as input.
I am attaching a sample to this answer, here are the steps to use it.
Create a new entity called “US States” in your Data Service instance with the following structure -
Unzip the attached project, make sure you are connected to your Cloud Account tenant with your Data Service instance and run it.
It should create 50 records for the States in your instance and do it via 2 calls.
Let’s look at what I am doing within the project -
I read the data from a CSV to a data table ->This can be from Excel or from scrapping as well).
I set the batch size to 25 records → This is only because I want to update in batches of 25 records. The batch activities support up to 1000 records in a single call. I have used it as a sample to show how to handle scenarios where you may be creating/updating more than 1000 records. You will set the batch size to 1000 in that case.
I have initialized the list variable to New List(Of USStates) to create an empty list.
I am using a For Each loop to iterate through all records in my data from the CSV.
For each row from my data table, I initialize a new variable and set the values for the three fields of type USStates.
I add the new record to our earlier list using Add To Collection activity.
Next, I check if the size of the collection has become equal to my batch size.
If it has, I use the Create Multiple Entity Records activity to create all the records using a single call → Due to the If condition in #7, this call will be made only every 25 records in our case.
After creating the records, I clear my collection so the next set of records will be added to it.
As last step after the For loop, I make sure that there are no remaining records in the collection and make sure to create them before finishing the workflow → This is needed, in case where the count of records doesn’t exactly match our batch size. For ex, if we were creating 80 records, the If condition on #7 will have been satisfied on 25th, 50th and 75th record but not again after that. The remaining 5 records will be captured by our last If condition and created after the For loop.
Hi, I created a plug and play solution for bulk upload just in case if anyone is looking for it. Make sure you remove the TEMP sequence and in_YourEntityList should be of type
in_YourEntityList =new List (Of EntityTypeCreatedByYou)
I am trying to use “Delete multiple entity records”. i dont know how to set the variable type for it.
List records are needed in the Create and Update multiple entity records.
BUT in Delete multiple entity records , the variable type is records of ids.
Hi @eimon, Sorry that our documentation was not clear on this, we will make it better.
For the Delete multiple entity records activity, you need the input to be either ICollection<Guid>, IList<Guid> or List<Guid>.
Here is a sample using the List<Guid> type which I populate from listRecords that I retrieve using Query activity. Notice that I initialize the recordsToDelete as New List<Guid> before I add items to it.