script to export xml

Hafsa1
Mega Sage

Hi,

I have a catalog item which used to create user in "sys_user" table with name prefixed with "DEMO.........". Able to create user using "run script" in workflow.

Now we have to modify this catalog item to adopt below functionality.

One select box(Snow Instance Name) is created whose values are "dev", "uat", and "sub_prod". The catalog item is on PROD. Now if requestor select say "uat" then the user should be inserted in PROD as well as UAT instance of snow. similarly, if requestor select "sub_prod" then user should be inserted into PROD as well in SUB PROD instance of snow.

So , basically either I need to insert user in PROD first and then copy the XML of it and create same user in sub_prod, uat, dev instance. Is that possible to import and then export XML to another instance via script??

3 REPLIES 3

Mateen
Giga Guru

I don't think there is a way to transfer XML between instances and uploading it via script. You can try to use REST API calls and insert users in you sub prod instances. That's easiest and fast way to achieve your requirement.


do you have any rest script to insert user record?


Use REST API explorer to get sample script. It is pretty self explanatory



REST API explorer



Let me know if you need any assistance