How to update the records on a form ?

Mike S3
Giga Expert

Hi , 

We have a form that consists of multiple different types of forms . 3 of the forms will create a new record , but one of the forms will update a previous existing record. 

Users are accessing the form from the following link through the service portal : 

find_real_file.png

I've set sys_id as -1 because we want the form to be blank initially then as they fill in info we figure out which form they need.  If the user selects Request type = Review 1 , then a reference field called u_test (referencing test table) comes up where they can select the previous record . On submit we would like to update that record with the fields filled out instead of creating a new record. 

This form is displayed using the out of the box form widget . Does anyone have any insight on what the best approach would be for this use case ? 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not use record producers for this or catalog item for updating the existing records?

you can allow user to select existing record; have variables which user wish to update on record

once submitted query, get variable value and update the record.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not use record producers for this or catalog item for updating the existing records?

you can allow user to select existing record; have variables which user wish to update on record

once submitted query, get variable value and update the record.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

shloke04
Kilo Patron

Hi @Mike S 

When you say 3 of the form will be creating new records and 1 of them will be updating a record? Does this mean 3 records on the same table or on different table here?

I would say Record producer gives you this flexibility to create records in different target table where you can utilize Record producer script to check based on your variable selection and do a Glide Record to create new records and also using the same script you can update your record as well.

Please share more info to assist you further.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Can you provide the script to update the existing record. I tried many ways but it keeps on creating the new record. I wanted to update the form in cmbd_ci_computer table from record producer.

Islamiyah Salah
Tera Contributor
Hi all, Am having the same issue. I created a record producer for new hire and a catalog item for checklist I want the name field value from the record producer to auto populate on the name field in the checklist form. Thank you for looking into this for me