View this page in the latest version of Appian. a!urlForPortal() Function Share Share via LinkedIn Reddit Email Copy Link Print On This Page Returns a URL for a portal 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!urlForPortal( portalPage, urlParameters, locale ) Keyword Type Description portalPage Portal Page A reference to a portal page, configured using the portal! domain. The structure of the portal reference is portal![portal name].pages.[page web address identifier]. This parameter is required. urlParameters Map Passes values to rule inputs configured in the target page of the portal 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. locale Text Optional locale to use when displaying the linked portal. Valid values: a locale code that is enabled in the Admin Console. For example, "en_US" for English (United States). Refer to the Appian Administration Console for a list of available locale codes. Returns Text Using the function The following sections cover important details about the a!urlForPortal() function. Referencing portal pages The portalPage parameter takes a reference to a portal page that is constructed using the portal! domain. See Reference Site and Portal Pages to learn how to construct a portal 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 portal 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!urlForPortal() 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!urlForPortal A portal that isn't published. An error page displays. Expression evaluation error. A URL parameter name that isn't in the Rule Input Configuration grid for the portal 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. 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://[portal-domain]/[portal 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.appianportals.com/projectportal/page/projects?county=Fairfax&active=true If the page was within a page group, the URL would display as: https://statedot.appianportals.com/projectportal/group/transportation/page/projects?county=Fairfax&active=true Note: If your portal 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 portal page, the URL parameters will display in plaintext. Examples The following examples demonstrate the a!urlForPortal() function. These examples reference portals from another environment and will error if you try to use them in yours. Use them as a reference only. Link to a portal page 1 2 3 4 5 6 7 8 a!urlForPortal( /*Replace the portal page and URL parameters with valid references from your environment*/ portalPage: portal!DOT Project Portal.pages.project-grid, urlParameters: a!map( county: "Fairfax", active: true ) ) If Encrypt URL parameters is turned on for the page, returns something like: https://insurecorp.appianportals.com/dot/page/projects?$sp=AAAAAQAAAAAAAAABAAAAEJipwSTzHzI679DzFIjKqeml6sPuuyAWuAnrDIgMG7D5YVbpCLs1Aq5dZHWqbmLw2Z7wpMI6t6lnbmhP6yg7_4WSE_nNUi8WrhryW08 The encrypted characters for the URL parameter will change each time a!urlForPortal() is executed. If Encrypt URL parameters is not turned on for the page, returns: https://statedot.appianportals.com/projectportal/page/project-grid?county=Fairfax&active=true Link to a portal page with a locale specified When you know what locale the user will want, use the locale parameter to specify the locale in the link. For example, imagine you have a portal that displays in both English and Spanish with English as the default. When users submit a request, you send them an email with a link to view the details of their request. For Spanish-language users you could automatically open the portal in Spanish by specifying the locale in the link. 1 2 3 4 5 6 7 8 9 10 11 12 a!safeLink( label: "VER SOLICITUD", uri: a!urlForPortal( /* Replace the portal page and URL parameters with valid references from your environment */ portalPage: portal!DOT Portal.pages.service-request, urlParameters: a!map( requestId: ri!requestId, /* This sets the portal locale to Spanish using the "es" locale code */ locale: "es" ) ) ) Feature compatibility The table below lists this function's compatibility with various features in Appian. Feature Compatibility Note Portals Compatible 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 Was this page helpful? SHARE FEEDBACK Loading...