The CreatorCon Call for Content is officially open! Get started here.

State of Update in Transform script

Daryll Conway
Giga Guru

I'm running an onBefore script on a transform map and I need to set the Import set Row state to update.

I'm aware of the ignore = true setting but I can't find a way to set this to 'update'.

Is this possible?

15 REPLIES 15

So


Before the upgrade


An onBefore script runs.


If the row does not have a sys_id, the script creates a new record


If the row did have a sys_id, it updated the record



now it is just creating records each time ?


We are still on Calgary so I cannot check, but on looking one of the target fields allows me to choose sys_id from the target table.


if you have the sys_id in your import set you can create a map between the source.u_sys_id and the target.sys_id and make that a coalese field.


Should do what you want


If no sys_id is given then what happens when setting the target sys_id?


This is the issue we ran in to where by the new sys_id given would clash with an existing one and instead of updating it would just make the import set hang in a processing state.



This issue is due to the update (hence why the normal approach isn't working), I have raised a ticket with SN but I needed a quick fix as there are thousands of incidents generate everyday from our integrations.



I've managed to create a work around where by I've sent a status message when I do an update so although it sends a response of 'ignored' the status message can let the 3rd party application know it's been updated and not just ignored.



Not ideal but it works.


Thank you for you assistance.


The sys_id is meant to be unique in all tables, so you should never have a clash unless you are trying to add your own and it can then do that.


also, if the field is set to coalese, the instance should know automatically to add or update.



In the source records, how is that sys_id generated ?



I'll see if I can try something tomorrow on a dev or a developer instance.


also remember that coalese can be more than one field. It can be as many as needed


If you can work out what makes each row "unique" then make all those fields the coalese fields


When there is no sys_id one is created for you (no problem).


When you give one that already exists it doesn't recognize that you are trying to add to the existing record and tries to create a new record with the given sys_id which of course it can't because it already exists.



Instead of using the transform map fields I'm forced to use an onBefore script where I do a glide record call against the sys_id to get the record then update using a glide record update().