Question

DataService - Get ID(s) of Updated Records

When issuing a InsertQuery if the insert operation is successful, the unique identifier for the record is return within the response payload as "Id". It is possible with an UpdateQuery to get the IDs of the updated record(s)? All that is returned is RecordsAffected and whether it was successful. I realize in this case the "Id" attribute may need to be returned as an array.

Like 0

Like

5 comments

Unfortunately, there is no way to do that. Try to create a field like "modificationId" and update the field with a value. Then select the fields by the value in the field. 

Thanks for the reply - that's what I figured but just wanted to confirm. I have already implemented a similar workaround, but obviously it's not ideal since it requires the invocation of another API request for each record I process. Is there an official process to create a feature request? I would recommend implementing this feature for the DataService API. I often have to move large amounts of data. Reducing API calls not only reduces load on the servers, but also increases the overall speed of our migrations.

Aron Hoekstra,

I can create the request for you. However, it will not speed up the migration. If bpm'online creates the feature for the update query then we'll execute a select query and then we'll update the selected records. It will take even more time than a simple batch query. The batch query with an update and a select query will already reduce the requests amount a specially if it uses "modificationId".

Eugene Podkovka,

Ah, I understand. I thought maybe internally you were looping through the rows and updating each one (so you already had the IDs handy), but you are probably just building a simple UPDATE statement. I'll stick with my current workaround then. Thanks

Aron Hoekstra,

Please consider using batch queries. It's important. 

Show all comments