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

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 P records are lnked to t record . We create  records clicking on NEW button on related list of  record . I want to auto populate the field value of  name field on  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 name (Reference field) field on   form , it redirects to that record . Could you please suggest how to approach this ? Please let me know if you need more info .  

 

 

Thank You

1 ACCEPTED SOLUTION

@1_DipikaD 

as you can see the i icon is seen means the value is getting populated.

which field in main table is marked as Display=true?

Does that field have value in it?

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

View solution in original post

16 REPLIES 16

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