Free cookie consent management tool by TermsFeed

a!urlForSite() Function

On This Page

Returns a URL for a site page. Use where a!pageLink() can't be used, like external systems and emails. See When to use the page link component to learn when to use each link type.

Parameters

a!urlForSite( sitePage, urlParameters )

Keyword Type Description

sitePage

Site Page

A reference to a site page, configured using the site! domain. The structure of the site reference is site![site name].pages.[page web address identifier]. This parameter is required.

urlParameters

Map

Passes values to rule inputs configured in the target page of the site object. Use a!map() to provide a map of up to 10 URL parameter names and their associated values as key-value pairs. For example: a!map(state: "Virginia", priority: 4). See Use URL Parameters for Site and Portal Navigation for more information about using URL parameters.

Returns

Text

Using the function

The following sections cover important details about the a!urlForSite() function.

Linking to sites across environments

This function makes it easy to link directly to site pages in other environments without hardcoding a link, which is fragile, or using constants, which is cumbersome.

The function automatically uses the domain from the environment from where the link is accessed.

For example, in a development environment, a link created with a!urlForSite() might look like https://dot-dev.appiancloud.com/projectsite/page/project-dashboard. But when you access the link from a production site, it would look something like https://dot.appiancloud.com/projectsite/page/project-dashboard.

Referencing site pages

The sitePage parameter takes a reference to a site page that is constructed using the site! domain. See Reference Site and Portal Pages to learn how to construct a site page reference.

Using a!map()

To create a list of the URL parameter names and values for the urlParameters parameter, use the a!map() function to create a list of the URL parameters as key-value pairs. Use the URL parameter name configured in the Rule Input Configurations grid as the key in the key-value pair.

Note that you can also use a dictionary.

Tip:  Click the site page reference to view the URL parameter names. They are listed in the expression documentation pane under Enabled URL Parameter(s).

For example:

1
2
3
4
5
6
urlParameters: a!map(
  /*URL parameter name = county, URL parameter value = "Fairfax"*/
  county: "Fairfax",
  /*URL parameter name = active, URL parameter value = true*/
  active: true
)

This example is for illustrative purposes only. It won't work if you copy and paste it into an expression.

Error handling

This table outlines scenarios that could cause a link to error. To avoid broken links, we've implemented certain error handling. This error handling behaves differently depending on if you use a!urlForSite() or construct the links manually using plaintext URL parameters.

Additionally, if someone changes or deletes a character in an encrypted URL parameter string, all URL parameters that don't have a default value will be ignored.

If the following is used in a link... Behavior in manually constructed links Behavior in a!urlForSite
A URL parameter name that isn't in the Rule Input Configuration grid for the site page, such as when the URL parameter name is misspelled. The URL parameter is ignored.

The default value will be used for any rule inputs that have it configured.
Expression evaluation error.
A plaintext URL parameter that doesn't have Enable in URL selected. The URL parameter is ignored.
A URL parameter value that contains more than 100 characters. The URL parameter is ignored, unless it has a default value configured.
More than 10 URL parameters. All URL parameters are ignored, unless they have a default value configured.

Generated URL structure

The structure for the generated URL is:

https://[site-domain]/[site web address ID]/page/[page web address ID]?[encrypted or plaintext URL parameters]

For example, a URL with plaintext URL parameters might look something like:

https://statedot.appiancloud.com/projectsite/page/project-dashboard?county=Fairfax&active=true.

site url example

If the page was within a page group, the URL would display as:

https://statedot.appiancloud.com/projectsite/group/transportation/page/project-dashboard?county=Fairfax&active=true

Note:  If your site has only one page, /page/[page web address ID] won't display in the URL. However, if you manually add /page/ followed by the web address identifier, the link will still work.

By default, URL parameters are encrypted in the generated URL. If Encrypt URL parameters is turned off for the site page, the URL parameters will display in plaintext.

Examples

The following examples demonstrate the a!urlForSite() function.

These examples reference sites and record types from another environment and will error if you try to use them in yours. Use them as a reference only.

1
2
3
4
5
6
7
8
a!urlForSite(
  /*Replace the site page and URL parameters with valid references from your environment*/
  sitePage: site!DOT Project Site.pages.project-grid,
  urlParameters: a!map(
    county: "Fairfax",
    active: true
  )
)

If Encrypt URL parameters is turned on for the page, returns something like:

https://statedot.appiancloud.com/projectsite/page/project-grid?$sp=AAAAAQAAAAAAAAABAAAAEJipwSTzHzI679DzFIjKqeml6sPuuyAWuAnrDIgMG7D5YVbpCLs1Aq5dZHWqbmLw2Z7wpMI6t6lnbmhP6yg7_4WSE_nNUi8WrhryW08

The encrypted characters for the URL parameter will change each time a!urlForSite() is executed.

If Encrypt URL parameters is not turned on for the page, returns:

https://statedot.appiancloud.com/projectsite/page/project-grid?county=Fairfax&active=true

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Partially compatible

Can be used with Appian Portals if it is connected using an integration and web API.

Offline Interfaces Incompatible
Sync-Time Custom Record Fields Incompatible
Real-Time Custom Record Fields Incompatible

Custom record fields that evaluate in real time must be configured using one or more Custom Field functions.

Process Reports Incompatible

Cannot be used to configure a process report.

Process Events Partially compatible

If autoscale is enabled, can be used to configure a supported process event node (such as a start event or timer event).

Process Autoscaling Compatible

Can be used in autoscaled processes.

Event Consumer Filter Conditions Incompatible

Cannot be used in filter conditions.

Event Consumer Event Handlers Incompatible

Cannot be used in event handler expressions.

Feedback