Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

sysId of record created in UI Builder

HaritChandel
Tera Contributor

how can i get the sys_id of the record created throgh create record data resource, i have tried various answers from communities but none is working. Requirement is when the record is getting created through a button, then store the sys_id of that record, so that we can further use to fetch or manipulate data

1 REPLY 1

Kevin83
ServiceNow Employee
ServiceNow Employee

I created a create record data resource and a button to invoke it:

Screenshot 2024-10-03 at 4.16.41 PM.png

I created a script like so:

Screenshot 2024-10-03 at 4.14.39 PM.png

That I call on success of the data broker like so:

Screenshot 2024-10-03 at 4.14.52 PM.png

And you can see the sysid of the new record created in the logs: 

Screenshot 2024-10-03 at 4.15.01 PM.png
in my case I can access the sys_id like this `

event.payload.data.output.data.GlideRecord_Mutation.insert_incident.sys_id.value`