Hiding Record URL behind a text

I am retrieving a Record URL using urlforrecord() function but all it gives me the complete URL string. My requirement is to hide the long URL string returned, by a text suppose "Record Link", I don't want to show that complex URL string in the mail the user gets just the text on the click of which it redirects it to the URL. Is there any way in appian to achieve this.

Thanks

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    In an email you can simply use an HTML hyperlink.  i.e.

    <a href="http://myappian.com/suite/tempo/records/item/ASDFQWER/view/summary">Record Link</a>

  • Thanks Mike, that worked like a charm. But as I told currently I am using urlforrecord() which returns tempo URL for record, I want the site URL of Record as the user will be performing most of it's tasks in site only, only in very rare cases he might be navigating to tempo and for record only every time we don't want him to leave site and see the record in tempo.

    Any solution for this.

    Thanks

  • +1
    Certified Lead Developer
    in reply to varunkumarb0001

    To add onto what Peter already said in his reply above -- I recently broke down and just created a systemwide expression rule to help in the quest to create a Sites-centric link to a record, as follows:

    /* GLBL_createRecordURLForSite */
    
    a!localVariables(
      local!defaultURL: urlforrecord(ri!recordType, ri!recordId),
      local!addSiteContext: if(
        rule!GLBL_isBlank(ri!siteName),
        local!defaultURL,
        if(
          rule!GLBL_isBlank(ri!recordId),
          /* Didn't see an easy way to link a record list in sites context */
          local!defaultURL,
          substitute(
            local!defaultURL,
            "tempo/records/item",
            "sites/" & ri!siteName &
            if(
              rule!GLBL_isBlank(ri!sitePageContext),
              "",
              "/page/" & ri!sitePageContext
            ) &
            "/record"
          )
        )
      ),
      local!addDashboardContext: if(
        rule!GLBL_isBlank(ri!dashboardStub),
        local!addSiteContext,
        substitute(local!addSiteContext, "summary", ri!dashboardStub)
      ),
      
      local!addDashboardContext
    )

    This code provides the opportunity to use 2 optional parameters: "site page context" allows you to pass in a site page (tab) name, and when used, the opened link will appear as if the user is on that "tab" (otherwise none will be highlighted); and "dashboard stub" allows you to direct to a dashboard (view) on the opened Record, other than the default (summary) view.

Reply
  • +1
    Certified Lead Developer
    in reply to varunkumarb0001

    To add onto what Peter already said in his reply above -- I recently broke down and just created a systemwide expression rule to help in the quest to create a Sites-centric link to a record, as follows:

    /* GLBL_createRecordURLForSite */
    
    a!localVariables(
      local!defaultURL: urlforrecord(ri!recordType, ri!recordId),
      local!addSiteContext: if(
        rule!GLBL_isBlank(ri!siteName),
        local!defaultURL,
        if(
          rule!GLBL_isBlank(ri!recordId),
          /* Didn't see an easy way to link a record list in sites context */
          local!defaultURL,
          substitute(
            local!defaultURL,
            "tempo/records/item",
            "sites/" & ri!siteName &
            if(
              rule!GLBL_isBlank(ri!sitePageContext),
              "",
              "/page/" & ri!sitePageContext
            ) &
            "/record"
          )
        )
      ),
      local!addDashboardContext: if(
        rule!GLBL_isBlank(ri!dashboardStub),
        local!addSiteContext,
        substitute(local!addSiteContext, "summary", ri!dashboardStub)
      ),
      
      local!addDashboardContext
    )

    This code provides the opportunity to use 2 optional parameters: "site page context" allows you to pass in a site page (tab) name, and when used, the opened link will appear as if the user is on that "tab" (otherwise none will be highlighted); and "dashboard stub" allows you to direct to a dashboard (view) on the opened Record, other than the default (summary) view.

Children