- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2022 12:48 AM
I am looking for a way to submit a form onload. I am fetching the values from a 3rd party tool via integration. I got the values in the CS but not sure how do I make the form as submitted.
Conditions in the code looks something like below. I want to set the fields and then submit the form.
if(response=="authorized")
{
g_form.setValue('alm_user',true);
}
Any help is highly appreciated!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2022 12:50 AM
Hi Shweta,
This looks a straightforward scenario to me.
Have you checked the g_form.submit() method. It will simply submit the form when the conditions are met. This is fine if you want this to be achieved using onload cs.
Add it in the code like below.
if(response=="authorized")
{
g_form.setValue('alm_user',true);
g_form.submit();
}
Regards,
Shubham
Shubham Tipnis
ServiceNow Enthusiast
⭐️ 3x Rising Star (2022–2024) – ServiceNow Community
Sharing insights, use cases & real-world learnings from the Now Platform
Always learning. Always building.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2022 12:50 AM
Hi Shweta,
This looks a straightforward scenario to me.
Have you checked the g_form.submit() method. It will simply submit the form when the conditions are met. This is fine if you want this to be achieved using onload cs.
Add it in the code like below.
if(response=="authorized")
{
g_form.setValue('alm_user',true);
g_form.submit();
}
Regards,
Shubham
Shubham Tipnis
ServiceNow Enthusiast
⭐️ 3x Rising Star (2022–2024) – ServiceNow Community
Sharing insights, use cases & real-world learnings from the Now Platform
Always learning. Always building.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2022 12:56 AM
Thanks