1132
Views
13
Comments
Parse a URL QueryString for specific key
Question
Hi - I need to get values from the querystring.  I looked through the HTTPRequestHandler and can't seem to find a function already defined.  Or am I just overlooking something?

In C#, I would use something like this: Requst.QueryString["key"].  I was hoping that this extension would provide me this functionality. 

Thank you
2019-12-19 12-29-01
Mário Coelho
Hi David,

I think you miss the GetFormValue action of the HTTPRequestHandler ("Gets the value of a form field of the current HTTP request.")

Recieves the name of parameter, returns the value.

Best regards,
Mário Coelho
2018-01-22 14-25-08
David Zangger
Thanks Mário.  I tried that as well but all i got was a blank value; or undefined in the debugger view.

Update: I ended up creating my own extension action to get the key/value pair. 
2019-12-19 12-29-01
Mário Coelho
It's good to hear!

I forgot to say that for querystring that method only works on Preparation.
 
It's also possible to do it client-side, for example with this jQuery plugin https://plugins.jquery.com/url/ plugin but it requires much more work and java scrip tricks.

Best regards,
Mário Coelho
2012-03-16 12-21-09
João Rosado
Staff
Hi,

Why didn't you just add a input on the screen with that name and let the platform do it for you? Does the key change?

Regards,
João Rosado
2018-01-22 14-25-08
David Zangger
Hi João - The link is embedded in an email and it contains a unique key.  I need to grab that key to verify the user from the email.  There are no input fields for these querystring parameters.
2016-04-21 20-09-55
J.
 
MVP
not sure what the problem is exactly.


1. users will click the link in the email right?
2. so, the link will go to something like https://<outsystemserver>/Espace/Link.aspx?key=6736hdsf
(or jsf if it's javastack)
3. this means, if you have a page named "Link" in your espace, and with inputparameter key of type text, it will get filled properly
so not sure why it doesn't work in your case.

UserImage.jpg
Rizi
J. wrote:
not sure what the problem is exactly.


1. users will click the link in the email right?
2. so, the link will go to something like https://<outsystemserver>/Espace/Link.aspx?key=6736hdsf
(or jsf if it's javastack)
3. this means, if you have a page named "Link" in your espace, and with inputparameter key of type text, it will get filled properly
so not sure why it doesn't work in your case.
 
 Have you solved this issue?
 
2018-01-22 14-25-08
David Zangger
Thank you Statler - I didn't try putting an input field on the form.  Sounds like it could work. 

Update: Statler, that worked perfectly.  I added the Key as an input parameter to the page and the field was populated exactly like I wanted.  Thank you for the suggestion.
2012-03-16 12-21-09
João Rosado
Staff
Hehe that was what I tried to explain.
Sometimes solutions are so simple that they look too good to be true. ;)

Nice that you got it working.

Regards,
João Rosado
2020-05-27 11-47-28
Brajesh Mehra
How can I get query String parameter on the page?

I have tried putting input field.

Please help
2019-11-12 17-31-26
Justin James
 
MVP
Brajesh -

Add an Input parameter to the page with the name of the parameter.

J.Ja
UserImage.jpg
Emanuela Avanzi

in my url I put a parameter ex. IDSite=1 and this one I need to save in a form and into the table.

How is it possible?

thanks





Justin James wrote:

Brajesh -

Add an Input parameter to the page with the name of the parameter.

J.Ja



2026-03-09 12-26-51
Fábio Fantato
 
MVP

Hi Emanuela,

One tip, it is not a good idea resurrect old posts. If they have 2 or more years, it is preferable to start a fresh one. 

Anyway, to understand better how to deal with Input Parameters and Forms/Entities, I suggest you to see this exercise https://www.outsystems.com/learn/lesson/855/data-queries-and-widgets-ii-exercise/

This will cover exactly the subject you are asking here.

It is part of this course: https://www.outsystems.com/learn/courses/15/developing-outsystems-web-applications/?StartCourse=False

 Basically, the IDSite will be an InputParameter for your screen. So, inside you screen you will be able to use this parameter in anypoint of you flow, including into Create and/or Update actions to store into you entities.


Best Regards

Fabio Fantato


Emanuela Avanzi wrote:

in my url I put a parameter ex. IDSite=1 and this one I need to save in a form and into the table.

How is it possible?

thanks





Justin James wrote:

Brajesh -

Add an Input parameter to the page with the name of the parameter.

J.Ja




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