How to autopopulate a field value based on same field value present on a different table ?

1_DipikaD
Kilo Sage

Hi All,

 

I want to  auto populate a field value based on same field value present on a different table. As shown in the below picture Pentest finding records are linked to Pentest project record . We create Pentest finding records clicking on NEW button on related list of Pentest project record . I want to auto populate the field value of project name field on Pentest finding record at the time while clicking on New button. I  can't find any UI action exists for this . But when I click on ' i ' button besides the Project name (Reference field) field on Pentest finding  form , it redirects to that Pentest project record . Could you please suggest how to approach this ? Please let me know if you need more info .  

 

1_DipikaD_1-1757679484100.png

 

1_DipikaD_0-1757679047598.png

 

Thank You

8 REPLIES 8

M Iftikhar
Mega Sage

Hi @1_DipikaD

My understanding is you’re asking how to automatically fill the Project Name on a new Pentest Finding record when creating it from a Pentest Project’s related list.

If yes, you can try any of below approach:

  • Default Related List Behavior:

    • When you click New from a related list, ServiceNow already passes the parent Project reference into the Finding form. If you only need the project name for display, you can dot-walk from the reference (finding.project.name) without storing it separately.

  • Client Script (onLoad):

    • If you want the Project Name field on the form to show immediately, use an onLoad Client Script to fetch the reference record and set the Project Name field.

  • Business Rule (on Insert):

    • If you need the Project Name stored in the Findings table (for reporting/search), add a before-insert Business Rule to copy current.project.name into your project_name field.

NOTE: 

The related list New button is system-generated, and you should extend functionality using Client Scripts or Business Rules.

 

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@1_DipikaD 

by default when New button is clicked on related list the Project name field on "Pentest finding" should get auto populated.

I could see it's getting auto-populated as I could see i icon

which other field on Pentest finding you want to be auto-populated when New button is clicked?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar , @M Iftikhar ,

 

Thanks for your response . The SS are of older records but currently if I want to create new record the value is not getting auto populated . It's for the same field as I mentioned on ss. Unable to do dotwalk for this . Could you please guide me how to do dot walk for this ?

 

Thank You

@1_DipikaD 

when you click New in related list does it not populate that Reference field on "Pentest finding"?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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