How to create a table using script

Tim61
Kilo Contributor

Hello,

I want to create table with two column as below setting using script:
Table Label: Computer ID
Table Name: u_computer_id
Extends table: Configuration Item

Column label: Computer NameType: StringMax length: 90Column name: u_computer_name
Column label: Type
Type: StringMax length: 32
Default value: Exports to::Imports from
Display: true
Column name: u_type
How to create above table using script in ServiceNow Scripts - Background?

Thanks,
Tim

1 ACCEPTED SOLUTION

Hi Tim, 

Good to know its working. Please mark it as correct, if you are satisfied with the solution and close this thread.

 

Regards,

Karishma

View solution in original post

14 REPLIES 14

Rajesh Mushke
Mega Sage
Mega Sage
Hi Tim, i haven't tried yet this, but we will try this now. i would like to know the reason why do you want to insert the table with background sctipt? Thanks, Rajashekhar Mushke Community Leader-18


Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

Hi Rajashekhar Mushke,

Here is my reason:

I need to create 20 tables in ServiceNow. If I don't have script to create it,I need to create it in ServiceNow UI and do this step with 20 times.

If I have script then I can execute the script once to create 20 tables in ServiceNow Scripts - Background.

Thanks,

Tim

Devyani_6
Mega Guru

Hi Tim,

We can create table by using script. I found few link which helps us to do this. Please go through below links.

https://community.servicenow.com/community?id=community_question&sys_id=a3cc8329db9cdbc01dcaf3231f96190b

https://community.servicenow.com/community?id=community_question&sys_id=614543addbd8dbc01dcaf3231f961964

 

Mark Correct/Helpful, If this helps you.

Warm Regards,

Devyani

find_real_file.png

|www.DxSherpa.com|

 

Tim61
Kilo Contributor

Hi Devyani,

Thanks a lot and I will try it.

Thanks,
Tim