- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 04:59 AM
Hi Developers/ @Ankur Bawiskar
This is related to one of the tricky requirement which I need to build.
I need to call an API on the load of a catalog form and the response I need to store in one of the catalog form field which is a drop down options field.
Please let me know how I can achieve this type of requirement.
Step by Step explanation would be helpful and also a type of sample code.
Thanks in Advance !!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2022 02:26 AM
@Rahul84 Have you tried this? if yes then please close the thread by marking all correct answers
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 05:30 AM
Create 3 new system properties
1. Production instance name
2. Integration User Name
3. Integration User Password
Then in the script get the values from system property and add them.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 05:45 AM
@jaheerhattiwale : can you help with one of the scenario for the enviroment thing only. I will replicate the same for credentails as well.
Please guide to have the sys_property for environment and usage in the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 05:56 AM
Create the properties in the sys_properties table.
then update script as below
restmessage.setEndpoint("https://"+gs.getProperty("<PROD INST NAME PROPERTY NAME HERE>")+"/<REMAINING URL HERE>");
restmessage.setBasicAuth(gs.getProperty("<USER ID PROPERTY NAME HERE>"), gs.getProperty("<USER PASSWORD PROPERTY NAME HERE>"));
Please mark all answers on this question.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 06:03 AM
and in the properties , what exactly we need to give like if I will create the property for instance.
type will be string ? and in value what should i give ? the servicenow instance url for dev and prod with comma seperated ? or the API url for dev and prod ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 06:07 AM
@Rahul84 Provide the name that you have to add in getProperty() function.
Keep prod instance name property string type and in value add prod instance name
Keep user name property also string type and add the prod integration user name to it
Keep password property as password2 type and add prod integration user password
You must have a user account created on the prod instance for this.
ServiceNow Community Rising Star, Class of 2023