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.

can we create field through script

venkat47
Kilo Contributor

i need to insert skill and experience if user have multiple skills so based on user create number of fields in record producer (like in form name and value type field  i need  alter native  to name and value type ) please solve this......!

6 REPLIES 6

Tushar Sharma2
Kilo Guru

Hello Venkat,

Create a record using script in the sys_dictionary table with table name and type of the field and then you would have to create a record in the Section Element (sys_ui_element) table. You would need to know the Form Section (sys_ui_section) the element should be on and the Form (sys_ui_form) that section is on.

Mark Correct if it solved your issue.
Regards,
Tushar Sharma
www.dxsherpa.com

Inactive_Use167
Mega Expert

Hi, 

 

If your instance is London version and above, you can create a variable set on the record producer which is of multi row type. This way you can give user a way to add a set of fields dynamically.

 

check this link

London version:

https://docs.servicenow.com/bundle/london-it-service-management/page/product/service-catalog-management/concept/c_ServiceCatalogVariableSets.html

 

 

Sharique Azim
Mega Sage

TLDR; Yes, but best practice is , you should not.

 

 

Why not, fields are just a dictionary records. so you can keep creatin records.

 

But i would definetely not advice the same , as there could be several other background things going to be affected during its creation.

I misintrepreted your question, as your subject  line is misleading.

 

 

so you want to create record producers to update fields on some sys_ table?

 

then the answer is, NO you cannot map.

 

But yes you can script to gliderecord those table and set it up accordingly.

 

something like var gr= new GlideRecord('table');

gr.insert();

gr.field= producer.field;