Help

Run Script get new record

Topic Labels: Automations
991 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Jordi
4 - Data Explorer
4 - Data Explorer

Hello guys,

I have created an automation that is being executed when a new record is created, what I wanna do is to get that specific new record in the script, the last one, how can I do that?

Jordi_0-1690379992941.png

 

1 Reply 1

Hi,
You can choose input parameters, such as trigger record ID, on the left side of script step menu.
All input variables, with names defined by you, passed to script by object input.config()
Then you should do smth like:

let inputData=input.config()
let recordID=inputData.ID
let userName=inputData.name

or, using ES6,

let {recordID, userName}=input.config()


You can also get values as parameters, but depending on the way of record creation, it might be empty, so you can choose another trigger.