AgileApps Support Wiki Pre Release

Difference between revisions of "Prefill Form Fields"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
By creating the appropriate URL, You can take a registered platform user to a [[Form]] that has select fields pre-filled with default data.
By creating the appropriate URL, you can take a registered platform user to a [[Form]] that has select fields pre-filled with default data. For example, you could put a link to that URL on a JSP page, and even JavaScript to acquire the data from other sources.


;Syntax:
;Syntax:
:{|
:{|
<tt>
<tt>
https://<i>domain</i>/networking/servicedesk/index.jsp?applicationId=<i>appID</i>#_<i>objectName</i><br> &nbsp; &nbsp;  &nbsp; /new/_form_title=<i>formTitle</i>/<i>fieldName</i>=<i>value</i>/...</tt>
https://<i>domain</i>/networking/servicedesk/index.jsp?applicationId=<i>appID</i>#_<i>objectID</i><br> &nbsp; &nbsp;  &nbsp; /new/_form_title=<i>formName</i>/<i>fieldName</i>=<i>value</i>/...</tt>
|}
|}
'''where:'''
:: ''Line breaks are added on this page for readability.'' The URL must be a single contiguous string.
:* The underscore ("_") before the objectName is required, as are the underscores in the keyword, <tt>_form_title</tt>
 
''where:''  
:* The underscore ("_") before the object name is required, as are the underscores in the keyword, <tt>_form_title</tt>
:* ''<tt>domain</tt>'' - The domain used to access the platform.
:* ''<tt>domain</tt>'' - The domain used to access the platform.
:* ''<tt>appID</tt>'' - The application ID, taken from the [[Application Properties]].
:* ''<tt>appID</tt>'' - The application ID, taken from the [[Application Properties]].
:* ''<tt>objectName</tt>'' - The name of the Object, taken from the [[Object Properties#Object Information|Object Information]] section of the Object Properties.
:* ''<tt>objectID</tt>'' - The ID of the Object, taken from the [[Object Properties#Object Information|Object Information]] section of the Object Properties.
:* ''<tt>formTitle</tt>'' - The name of the form, taken from the [[Form#Form Properties|Form Properties]].
:* ''<tt>formName</tt>'' - The name of the form, taken from the [[Form#Form Properties|Form Properties]].
:* ''<tt>fieldName</tt>'' - The name of a [[Field]] that is displayed in the form.
:* ''<tt>fieldName</tt>'' - The name of a [[Field]] that is displayed in the form.
:* ''<tt>value</tt>'' - The value to pre-fill.
:* ''<tt>value</tt>'' - The value to pre-fill.


;Considerations:
:* Only fields included in the form can be pre-filled. (Note that you can include ''hidden'' fields in a form, in order to include data that isn't immediately visible to the user.)
:* When examining a Form, you see field labels. But the internal field ''name'' must be specified in the URL.
:* For all parameter values, use "+" in place of a space.<br>Example: <tt>217 Jason Street</tt> becomes: <tt>217+Jason+Street</tt>
:* Parameters must be specified in the order shown, separated by a slash ("/")
:* If a data value includes a "/", encode it using %2F.<br>Example: <tt>either/or</tt> becomes: <tt>either%2For</tt>
;Example:
;Example:
:This HTML code displays a "Click here" link in a JSP page. When clicked, the user is directed to a form that has two fields pre-filled.  
:This HTML code displays a "Click here" link in a JSP page. When clicked, the user is directed to a form that has two fields pre-filled.  
::{|
::{|
<tt>
<tt><b><a href="https://</b>processing.mycompany.com<b>/networking/servicedesk<br> &nbsp; &nbsp;  &nbsp; /index.jsp?applicationId=</b>123456789<b>#_</b>84758b<br> &nbsp; &nbsp;  &nbsp; <b>/new/_form_title=</b>Agent+Form<b>/</b>priority<b>=</b>1<b>/</b>status<b>=</b>Pending<b>"><br>
https://<b>mycompany.com</b>/networking/servicedesk/index.jsp?applicationId=<b>123456789</b>#_<b>objectName</b><br> &nbsp; &nbsp;  &nbsp; /new/_form_title=<b>formTitle</b>/<b>fieldName1</b>=<b>value1</b>/<b>fieldName2</b>=<b>value1</b></tt>
&nbsp; Click here<br>
</a></b></tt>
|}
|}
:In this example:
:In this example:
::* ''domain'' = <tt>mycompany.com</tt>
::* ''domain'' = <tt>processing.mycompany.com</tt>
::* ''appID'' = <tt>123456789</tt>  
::* ''appID'' = <tt>123456789</tt>  
::* ''objectName'' = <tt>xx</tt>
::* ''objectID'' = <tt>84758b</tt>
::* ''formTitle'' = <tt>xx</tt>
::* ''formTitle'' = <tt>Agent+Form</tt> ("+" replaces the space in the form name)
::* ''field #1'' = <tt>xx</tt>, ''prefill value'' = <tt>xx</tt>
::* ''field #1'' = <tt>priority</tt>, ''prefill value'' = <tt>1</tt>
::* ''field #2'' = <tt>xx</tt>, ''prefill value'' = <tt>xx</tt>
::* ''field #2'' = <tt>status</tt>, ''prefill value'' = <tt>Pending</tt>
 
;Considerations:
:* Only fields included in the form can be pre-filled. (Note that you can include ''hidden'' fields in a form, in order to include data that isn't immediately visible to the user.)
:* For all parameter values, use "+" in place of a space.<br>Example: <tt>217 Jason Street</tt> becomes: <tt>217+Jason+Street</tt>
:* Parameters must be specified in the order shown, separated by a slash ("/")
:* If a data value includes a "/", encode it using %2F.<br>Example: <tt>either/or</tt> becomes: <tt>either%2For</tt>


;Supported Fields:
;Supported Fields:

Latest revision as of 19:53, 31 July 2013

By creating the appropriate URL, you can take a registered platform user to a Form that has select fields pre-filled with default data. For example, you could put a link to that URL on a JSP page, and even JavaScript to acquire the data from other sources.

Syntax
https://domain/networking/servicedesk/index.jsp?applicationId=appID#_objectID
      /new/_form_title=formName/fieldName=value/...
Line breaks are added on this page for readability. The URL must be a single contiguous string.

where:

  • The underscore ("_") before the object name is required, as are the underscores in the keyword, _form_title
  • domain - The domain used to access the platform.
  • appID - The application ID, taken from the Application Properties.
  • objectID - The ID of the Object, taken from the Object Information section of the Object Properties.
  • formName - The name of the form, taken from the Form Properties.
  • fieldName - The name of a Field that is displayed in the form.
  • value - The value to pre-fill.
Considerations
  • Only fields included in the form can be pre-filled. (Note that you can include hidden fields in a form, in order to include data that isn't immediately visible to the user.)
  • When examining a Form, you see field labels. But the internal field name must be specified in the URL.
  • For all parameter values, use "+" in place of a space.
    Example: 217 Jason Street becomes: 217+Jason+Street
  • Parameters must be specified in the order shown, separated by a slash ("/")
  • If a data value includes a "/", encode it using %2F.
    Example: either/or becomes: either%2For
Example
This HTML code displays a "Click here" link in a JSP page. When clicked, the user is directed to a form that has two fields pre-filled.
<a href="https://processing.mycompany.com/networking/servicedesk
      /index.jsp?applicationId=
123456789#_84758b
      /new/_form_title=Agent+Form/priority=1/status=Pending">
  Click here
</a>
In this example:
  • domain = processing.mycompany.com
  • appID = 123456789
  • objectID = 84758b
  • formTitle = Agent+Form ("+" replaces the space in the form name)
  • field #1 = priority, prefill value = 1
  • field #2 = status, prefill value = Pending
Supported Fields
  • BOOLEAN (value should be either 1 or 0 )
  • CURRENCY
  • DOUBLE
  • GLOBAL_PICK_LIST
  • NUMBER
  • PERCENT
  • PHONE
  • PICK_LIST
  • RADIO_BUTTON
  • TEXT_FIELD
  • TEXT_AREA
  • TIME