How to update a record programmatically when you don't have its ID?

Hi,

As a consultant for my client, I must import their weekly backlog (CSV file) in the builder. This is always done manually of course, and they want me to find a way to have one of their employees do this from the App instead of the builder for security reasons.

During the import of about 600 entries, some are new (records are created) but most are updates on existing records.

I've written some Javascript to try to achieve this, but I can only create new records, not update existing ones because I don't know their IDs. All I have is the field value - in my case, a lot number. Typically, a six-digit string like 218309.

So... how can I do this?

BTW, I found this in the Developer Docs but the link is dead.

"We also have an example on how to find and store record IDs in a field programatically here."
(link is: https://www.knack.com/developer-documentation/#store-knack-id-in-field-example)

Also, I suspect that this example is suggesting to store the ID when the record is created, but it's too late now. The database has 5800 records already.

The only solution I see is to have a hidden table in the Import page that has the search field, and programmatically call a search on the lot number, then use JQuery to get the ID. I've done that successfully, but it's a very slow, two-step solution.

Any other idea is welcome.

Thanks,
Norm

Normand,

What I would do is implement the addition of the record ID on NEW Add's...

Then for the existing records, use a API GET RECORDS to dump the current records, this will give you their ID's.. Put the output into a CSV with just your lot number and the ID in the file and do a one time import using the lot number as the match. Then you'd have the record ID to match existing..

Julian