Skip to main content
Skip table of contents

Using URL Parameters

What are URL parameters?

URL parameters are parts of a URL that pass data to Web App. They are are often used to generate dynamic content on a web page, such as an e-commerce platform, or to pass data to an application, e.g. an online form. Another possible use case is deep links.

URL parameters can be activated in the Web App Configuration, in the .wac file.



How to use URL parameters:

The user clicks on a link with URL parameters as shown above. The URL parameters are passed into all Technical Processes called from the Component which was called by the URL. The URL parameters can then be used in mapping in the technical process.

Example

Example for technical process to get URL parameters:


First componentrequest.xml with operation Write

The URL parameters are passed from the link as input to the request.xml with operation Write.

request.xml with the input format is as follows. The root element of the XML depends on the used component, but the <Parameters> section is always identical:

Example for Input

XML
<?xml version="1.0" encoding="UTF-8"?>
<Get>
   <Component>Components/urlParameter.detail</Component>
   <Parameters>
      <Parameter key="message" value="hello"/>
   </Parameters>
</Get>


Second component: mapTo_UrlParameter.xsl

The information provided by the key and value can then be used in mappings.

Example of a mapping where only input with key='message' is allowed:

Example for Mapping

XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
  <xsl:output method="xml" media-type="text/xml"></xsl:output>
  <xsl:template match="/">
  	<Ok>
  		<URL_PARAMETER>
  			<xsl:value-of select="if(//Parameter[@key = 'message']) then //Parameter[@key = 'message']/@value else ('no Parameter')"></xsl:value-of>
  		</URL_PARAMETER>
  	</Ok>
  </xsl:template>
</xsl:stylesheet><!--Created by X4 Designer, Copyright © SoftProject GmbH. All rights reserved.-->


Output

The output with key='message' is as follows:

Example for Output

XML
<?xml version="1.0" encoding="UTF-8"?>
<Ok>
   <URL_PARAMETER>hello</URL_PARAMETER>
</Ok>



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.