URL parameters: what is sent after "?" is not seen by Servoy

Hello,
I am trying to send as parameter (in URL) to the webclient application that i am building something similar to Text?text. I am taking the argument: vArg = arguments[0]. When i check to see what is the argument it returns just: Text. So it’s as if it is not taking in consideration anything that is after the character “?”. Do you know why this is happening? I really need to see what is after the “?” character, because this is how some parameters from an external website are sent to me. I am using Servoy 3.5.7.
Thank you in advance for the answer!
DB

I do not know if this will help your particular situation, but you can send parameter(s) to webclient by creating and calling a global method like:

http://ipaddress/servoy-webclient/ss/s/solutionname/m/methodname/argument/parameter

Dean Westover
Choices Software, Inc.

Hello,

Thank you for replying to me.
I am doing like you mentioned,I am calling:
http://serverip:port/servoy-webclient/s … /Text?text
and when i get the argument:
var vArgument = arguments[0]
i see that vArgument == “Text”.
I also need to have access to what is after the question mark character, can anyone please help me on this?

DB

What value do you get from arguments[1]?

You can send in only 1 argument using the deeplink, so …/arguments/text

The var vArgument = arguments[0] will result in vArgument containing “text”

When needing to specify multiple arguments, do it like this: … /arguments/text0|test1|text2

and then in your code: var vArguments = arguments[0].split(‘|’)

Paul

Hi,

I know i can only send 1 argument. This is my argument: Text?text. And i need to have access to the whole text, but until now i can only access what is before the question mark.
I wouldn’t use the “?” but this is not up to me… The external website is adding some parameters to the deeplink I give them.And they add it like this:
?param1=value1&param2=value2…
So if my URL is:
http://URL
they will make a http request on:
http://URL?param1=value1&param2=value2….
I need to have access to “param1=value1&param2=value2…” to update my database.

This is very important to me,i would deeply appreciate if you can give me a solution to this problem…

Diana

The WebClient doesn’t support sending in arguments using the ?xxx=yyy&aaa=bbb notation

If you really need this, I’d setup a JSP on your Servoy Server that receives this request from the external application, reads the query parameters, transforms those into a URL that Servoy does understand and then redirect to the new URL.

If you wish, please file a feature request to support this for a future release.

Paul

I follow how to format the url, but not how to retrieve the parameter in a method and ultimately use it in a form to filter results. A little nudge or snippet would be greatly appreciated.

Scott

What have you tried so far? Can you post your URL/code to retrieve the argument?

Paul

My URL would be

http://localhost:8080/servoy-webclient/solutions/solution/autopay/method/showpayments/argument/asdf

And my global method would be

function showpayments()
{
		var crmid=arguments[0];
		return crmid;
}

so that I can use the crmid value in a servoy form to find related servoy records. And I am not sure the best way to use it in a form. Maybe a form method to call the global method.

Scott

One approach:

globals.key =arguments[0];

Then use globals.key as the left side of a relation.

Dean Westover
Choices Software, Inc.

function showpayments()
{
      var crmid=arguments[0];
      return crmid;
}

If that is your actual code in the method, I can understand why nothing happens: You retrieve the value and immediately return it. Return it to what?

As Westly says: you can store the value in a global which you can use in a relation or you can trigger a find/search (for example) in the showpayments method, to display the right record in your UI

Regards,

Paul

OK, with the help of a Servoy partner I was able to get it to work with the following global.js

/**
 * @properties={typeid:35,uuid:"b18b9879-b92c-4a42-a44e-4b2607d51c79"}
 */
var key = null;

/**
 * @properties={typeid:24,uuid:"8bfcceea-0d97-4532-989c-89af0daff175"}
 */
function showpayments()
{
	globals.key =arguments[0];
}

Thanks to all for your help.

Scott

pbakker:
You can send in only 1 argument using the deeplink, so …/arguments/text

The var vArgument = arguments[0] will result in vArgument containing “text”

When needing to specify multiple arguments, do it like this: … /arguments/text0|test1|text2

and then in your code: var vArguments = arguments[0].split(‘|’)

Paul

Hi All
I am trying to post data from an existing solution to a Servoy web client using the above deep linking example. The issues are that although I am getting the data passed I get an error on the split function descriobed by Paul

[Ljava.lang.Object;@eb69f3

=======

My mistake - not an error but an array of data !!! Sorry to waste the band width :oops:

Hi,
I received an email that this issue is solved and now Servoy “sees” the parameters that are sent after “?”. Could you please tell me what is the release where this has been solved?
DB

This will be in the next major version of Servoy.

Paul

What release would that be ?