18.4.0 released Sep 25, 2023
Input param

Purpose: Get input parameter for a request.

input-param <name>

To obtain input parameters from an incoming request, use input-param and/or task-param. Whether it's a web or command-line application, input parameters are specified as name/value pairs (see request-URL). The value of input parameter <name> will be in the string variable with the same name. Input parameter values are trimmed for whitespace (both on left and right).

Input parameter name can be made up of alphanumeric characters, hyphen or underscore only and cannot start with a digit. Note that a hyphen is automatically converted to underscore, so an input parameter "some-parameter" in the HTTP request will be known in your code as "some_parameter". For example in URL:
http://<your web server>/<app name>/some-request?my-par1=val1&my-par2=val2

the request name will be "some_request" (handled by some_request.vely source code), and input parameters will be "my_par1" and "my_par2":
input-param my_par1
input-param my_par2

File uploads
File uploads are handled as input parameters as well, see file-uploading.
Using input parameters
As an example, for HTML form input parameters named "param1" with value "value1" and "param2" with value "value2":
<input type='hidden' name='param1' value='value1'>
<input type='hidden' name='param2' value='value2'>

you can get these parameters and print out their values by using:
input-param param1
input-param param2
p-web param1
p-web param2

the output of which is:
value1
value2

A request may be in the form of a web link URL, and getting the parameter values is the same:
http://<your web server>/<app name>/<request name>&param1=value1&param2=value2

Duplicate parameter names
If there are multiple input parameters with the same name, such as
http://<web address>/<app name>/<request name>?par=val1&par=val2

the value of input parameter "par" is undefined. Do not specify multiple input parameters with the same name.
See also
Request information
get-req  
if-task  
input-param  
request-body  
set-input  
set-req  
task-param    
See all
documentation


You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a link back to this page (dofollow) - see full license at CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind.