how to get url parameter value in the server side script?

priyanka58
Tera Contributor

how to get url parameter value in the server side script?

1 ACCEPTED SOLUTION

Hi,

I shared solution for similar question yesterday and it worked for that member

sharing here again

Populate RITM to the worknotes

Regards
Ankur

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

View solution in original post

10 REPLIES 10

 I'm thinking that when you access gs.action.getGlideURI().toString() a script include triggered by a reference qualifier it doesn't have access to the page data yet as it has not been rendered. The full URL to the page is available client-side and the easiest way to access this on the server would be through the GlideAjax API.

 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you share your business requirement why to use url parameter in server side? which server side?

what you wish to do using that URL parameter?

Regards
Ankur

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

Hello,

Create a UI Action “Create Request" on Change Request:

  1. Create a group "Change Management" , add some users & button should only be visible to the members of "Change Management" group.
  2. When a user click on the button, it should redirect to the  catalog item "Apple iPad" on ServicePortal.
  3. When a user submit the request, the RITM number should be autopopulated in the work notes of that change request i.e. RITMXXXXXXXX is created.

So for that Firstly I create UI action in that I used action.setRedirectURL('/sp?id=sc_cat_item&sys_id=060f3afa3731300054b6a3549dbe5d3e&sysparm_change=' + current.sys_id) with extra URL parameter for redirect to the  catalog item "Apple iPad" on ServicePortal. 

After that used BR for updating change request work note so for that I need to extract URL for checking sys_id with url parameter sysparm_change.

 

regards,

Priyanka shukla

Hi,

I shared solution for similar question yesterday and it worked for that member

sharing here again

Populate RITM to the worknotes

Regards
Ankur

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

Hello Ankur,

Thank you for your response.

 

Regards,

Priyanka shukla