Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Populate values based upon the variable selection.

JVINAY
Tera Contributor

Hi Team,

I have created 4 fields in the form ( Record producer ), based on the questions from " Is this associated with a business application (APMID)" section

the remaining 3 questions are designed to auto populate  values based on the " Is this associated with a business application (APMID)"

These 5 fields are linked to the Business application ( cmdb_ci_business_app) .

JVINAY_3-1742294233345.png

 

fields and backend values :

 

 

I have written On-Change client script , but the values are not populating as expected. could you please assist me 

JVINAY_1-1742293903028.png

JVINAY_2-1742293950797.png

Thank you .

 

 

11 REPLIES 11

Ankur Bawiskar
Tera Patron

@JVINAY 

why not use auto populate feature and no scripting is required?

Auto-populate a variable based on a reference type variable (Utah) 

In your script don't use getValue() simply dot walk and get the values

something like this

associated_with_a_business_application.business_app_name

AnkurBawiskar_0-1742294654992.png

 

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

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

Hi @Ankur Bawiskar ,

Thanks for your response.

I'm experiencing an issue with the auto-populate option in the form. despite configuring the field mappings correctly , the values are not populating as expected. 

JVINAY_0-1742295463834.png

 

These 3 fields are in the Business application (cmdb_ci_business_app )Table 

JVINAY_0-1742296031138.png

 

Thank you.

 

@JVINAY 

it should work fine.

it's not working even for admins or for non-admins?

If it's not working for non-admin then it means it's an access issue.

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

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

Hi @Ankur Bawiskar 

These all fields auto populate based on the APM its working but in the Platform view auto populate values are not stored , it's showing blank like below image.

 It's working on Portal view

JVINAY_0-1742375553473.png

 

But Populate values not stored in the Platform or form level, once form got submitted all populated filed values showing blank like below image.

JVINAY_1-1742375553495.png

kindly help me on this.

Thank you .