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.
You can use safe link function and in label field mention the required name for the long URL
below is the sample code the requirement
local!url:urlforrecord(cons!A_AD_RECORD_TYPE, "7"), a!linkField( label:"link", links:a!safeLink( label :"Record Link", uri: local!url ) ) )
Thanks Ashwin for the reply, there are two sides of the requirement.
[@attributes=, label=link, instructions=, links=[@attributes=, uri=https://appian- mumbai.vpsapp.net/suite/tempo/records/item/lMBYMw7RwsTsh_lC78_BnnjnmneAAcR3V76G5nrZcN39TzPPbnDhfqN19y_6N591BcJAGYDBcjjq9qEkq5XgXx24X-2qITnvLohIP7jkCT88DsOmg/view/summary, label=Record Link, actions=, tooltip=, openInSameTab=], labelPosition=ABOVE, align=DEFAULT, actions=, helpTooltip=, accessibilityText=]
Instead, it should show "Record Link" on which I can click.
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.
If you want to direct to a site, you need to be a bit creative. The last path link is the same if you are using a site, but you will have to change the beginning part of the URL. For example, I extracted the long path part and concatenated the site information and /view/summary to build the correct site URL:
Between this and what Mike suggested below, you should be able to construct the URL to use in your email.
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 */
local!defaultURL: urlforrecord(ri!recordType, ri!recordId),
/* Didn't see an easy way to link a record list in sites context */
"sites/" & ri!siteName &
"/page/" & ri!sitePageContext
substitute(local!addSiteContext, "summary", ri!dashboardStub)
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.
Discussion posts and replies are publicly visible
© 2020 Appian. All rights reserved.