Skip to main content
saifalik8679
Known Participant
October 25, 2023
Question

Record Link URL in Email of a User

  • October 25, 2023
  • 1 reply
  • 0 views

Hi All, 
I have a scenario where I want to open a site with the record data context thought a mail sent to a user. 
The user will click on the site URL present in the mail and then he will be directly navigated to the exact context of the record data and the page where he want to go with the record data.
Can we achieve this identifier scenario for a recordtype based site URL?

1 reply

mikes0011
Brainy
October 25, 2023

This is a dirty workaround I invented back before we were able to force record links to open in a new tab, but I assume it should work for your use case.  Note that since it manually reconstructs the site-based Record URL, and that is semi-unsupported functionality, the way this works will be subject to change in the future with no notice when Appian changes anything in their back-end.

rule!UTILITY_getSiteRecordURL()

a!localVariables(
  local!defaultURL: urlforrecord(ri!recordType, ri!recordId),
  local!addSiteContext: if(
    isnull(ri!siteContext),
    local!defaultURL,
    if(
      isnull(ri!recordId),
      /* Can't link to a record list in sites context */
      local!defaultURL,
      substitute(
        local!defaultURL,
        "tempo/records/item",
        "sites/" & ri!siteContext &
        if(
          isnull(ri!sitePageContext),
          "",
          "/page/" & ri!sitePageContext
        ) &
        "/record"
      )
    )
  ),
  local!addDashboardContext: if(
    isnull(ri!dashboardStub),
    local!addSiteContext,
    substitute(local!addSiteContext, "summary", ri!dashboardStub)
  ),

  local!addDashboardContext
)

/* by: Mike Schmitt */