950
Views
10
Comments
Solved
how to get the parameter from url?
Question

Hi All,

I need to get the value from url

https://www.abc.com/verysystem?locationid=3&nameid=happy

How can i get locationid and nameid? when OnInitialize?


Thank you

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Jing,

I created a sample application as per the solution statement mentioned by Pramod Sir.


Check this out: 

1) Sample Application (For Dynamic URL)

2) Demo ParseURLScreen (as per the usecase)


PFA - includes the .oml solution.


Hope this helps you!


Regards,

Benjith Sam

ParseURLTask.oml
UserImage.jpg
jing tung wong

Benjith Sam wrote:

Hi Jing,

I created a sample application as per the solution statement mentioned by Pramod Sir.


Check this out: 

1) Sample Application (For Dynamic URL)

2) Demo ParseURLScreen (as per the usecase)


PFA - includes the .oml solution.


Hope this helps you!


Regards,

Benjith Sam

thanks.. it is working


2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Jing ,

Could you please some more details on what exactly you want to achieve .


Regards,

-PJ-

UserImage.jpg
jing tung wong

Halo PJ,


We several of QR code , different QR CODE have parameter locationid=3   or locationid=4 or locationid=5

when scan it will access the websystem to main page.. then get the locationid parameter to auto set the dropdown list location. let say 3 is location AAA, 4 is location BBB, 5 is location CCC.


Example: Lily scan one of the QR code when it is locationid=5.

When access to main page, the location "auto" set as "CCC".




2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Jing ,

If i understand it correctly , when you scan the QR code you will get the url with query string parameter and from that you need the parameter values.

you can try to parse the url in get the value of parameter .

For example first split your url (https://www.abc.com/verysystem?locationid=3&nameid=happy) by ? and you will get two part 

1. https://www.abc.com/verysystem

2.locationid=3&nameid=happy

again parse the 2nd value by & and put some more logic to get the exact value.

I hope i understand it correctly and the above solution is based on that only , correct me if i didn't understand it correctly .


Regards,

-PJ-

UserImage.jpg
jing tung wong

Hi Pj,


I know what you mean.. but i dunno how to work in outsystems enviroment.

Might to share some simple file?


Thank you

2025-08-22 10-19-44
Pramod Jain
 
MVP

Could you please first confirm if my understanding is correct ? i will than create a sample oml and will share with you .


Regards,

-PJ-

UserImage.jpg
jing tung wong

Yes, Correct.


2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Jing,

I created a sample application as per the solution statement mentioned by Pramod Sir.


Check this out: 

1) Sample Application (For Dynamic URL)

2) Demo ParseURLScreen (as per the usecase)


PFA - includes the .oml solution.


Hope this helps you!


Regards,

Benjith Sam

ParseURLTask.oml
UserImage.jpg
jing tung wong

Benjith Sam wrote:

Hi Jing,

I created a sample application as per the solution statement mentioned by Pramod Sir.


Check this out: 

1) Sample Application (For Dynamic URL)

2) Demo ParseURLScreen (as per the usecase)


PFA - includes the .oml solution.


Hope this helps you!


Regards,

Benjith Sam

thanks.. it is working


2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Jing ,

You can try the oml which Ben provided , however i created another example just to give you another approach of doing such things.Created a page and on button click wrote some javascript to parse and return the locationid and name id.

I did that on button click but you can use it anywhere.

Regards,

-PJ-

TestSplit.oml
UserImage.jpg
jing tung wong

Pramod Jain wrote:

Hi Jing ,

You can try the oml which Ben provided , however i created another example just to give you another approach of doing such things.Created a page and on button click wrote some javascript to parse and return the locationid and name id.

I did that on button click but you can use it anywhere.

Regards,

-PJ-

Yes,Ur sample very useful for me, because i never use JS in outsystems. I am sure sooner can use for other condition.

Thank you


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.