Retrieving field types using script include and client script

Ramel
Mega Guru

Hi Community,

We have created multiple custom tables with multiple different fields. Most of the field type is a decimal type of field. What I want to achieve is to retrieve all those decimal field types in different custom tables that we have created [x_custom_table_1, x_custom_table_2, x_custom_table_3, x_custom_table_4]

Does anyone have sample script include to do the retrieval that will send back the array? Then sample onload client script calling the script include that will check the current form is of table that starts with 'x_custom_table'?

Regards,

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can query sys_dictionary table with type as Decimal and table as your custom table

Then iterate and store in array

Regards
Ankur

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

Hi Ankur,

Do you have sample scripts?

Simply use GlideRecord on sys_dictionary table

Query as this

find_real_file.png

Regards
Ankur

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

@Ramel 

Thank you for marking my response as helpful.

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

Regards
Ankur

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