You are viewing limited content. For full access, please sign in.

Question

Question

SDK: Update many entries at once

SDK
asked on June 18, 2019

Hello, I have a Receipt template with a Teller field. Our teller field is a string, and we recently went from 3 digits to 4 digits. We would like to pad teller numbers that are less than 4 digits with leading zero's. I have been able to create a script that searches for receipts by date and updates one entry at a time. The problem is this will take a very long time. It takes about 20 minutes to do one week's worth, in our testing.

 

Is there a way with the SDK to update the values of multiple entries and do sort of a batch save instead of saving the records one at a time?

0 0

Replies

replied on June 18, 2019

No, there's no notion of batches in the SDK.  I am surprised at the performance you are seeing, I wonder if there's an easy way to make your process more efficient.  Minimizing the number of searches executed would be an easy win, actually updating the field value should be very fast.  Worst case you might consider directly updating the field data in SQL.  You lose the auditing for those changes, but you can't beat the speed.

0 0
replied on June 18, 2019

Hi. I appreciate the reply. We have an internal rule against updating the SQL directly. We have 1000's of receipts per week, which is why this is going as slow as it is. I guess I'll keep going with my current process. I'm going to schedule it to run over night.

0 0
replied on June 19, 2019

It sounds like there is a bottleneck somewhere in your SDK script. It should take no more than 100 milliseconds per entry to perform that kind of update. It would help if you could share some of your code.

0 0
replied on June 19, 2019

Well, it took 32 minutes yesterday to update approximately 35,000 entries. That's about 55 milliseconds per entry, if my calculations are correct. So that sounds about right, does it not?

0 0
replied on June 19, 2019

Sounds about right. If you email me some sample code (just where it retrieves the entries and updates them) I can look for potential optimizations.

0 0
replied on June 19, 2019 Show version history

Have you thought about using standard Workflow tools?

As long as your search can find the documents that you need to update, this will run and update/pad the field values.

 

I used a search that only returned documents with a 3 character value in the field:

{[]:[BC1]="???"} & {LF:Name="*", Type="D"}

 

0 0
replied on June 19, 2019

Our VAR told us to use SDK. They thought it would go faster than workflow. Either way, I think I'm ok with the performance.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.