urlForRecord function for Sites

Certified Lead Developer
Hi All,

urlForRecord function can be used to navigate to a record dashboard directly by passing the recordID. Do we have something similar for records which are part of Sites. For example, I want to divert a user from an external portal to a specific record dashboard on Appian site once authentication is done.

Thanks.
Hitesh

OriginalPostID-251745

  Discussion posts and replies are publicly visible

Parents
  • @hiteshd From my search I didn't find any. However you could still produce the url by writing an expression rule. Please find attached the image and code snippet that will help you in getting the url of a record that lies in a page of the site.

    Few things to note:
    1. I have used a!recordLink() to get the unique identifier of the record being generated by Appian as part of record's url. This is because fn!urlforrecord() failed in deriving a valid value. If you have time, I would suggest trying the fn!urlforrecord and get the identifier and test the same as the usage of a!recordLink() isn't a standard approach. In case if someone is interested in this, I have tried fn!reverse(fn!split(fn!urlforrecord(ri!recordType,ri!recordIdentifier),"/"))[3] but this identifier didn't work for sites though the same worked for tempo environment(maybe I am missing something?).
    2. I have used rule!APN_getSiteUrl() but I would suggest not to use it as this rule makes use of a deprecated function and I have used it just for demonstration. Use an expression rule or constant or query rule that drives the site url specific to the environment.
    3. Implement this code as an expression rule and reuse the same so that it would be easier to replace its contents or deprecate it when Appian relases a equivalent OOTB functionality or makes changes in the functions that were used in this expression rule.
Reply
  • @hiteshd From my search I didn't find any. However you could still produce the url by writing an expression rule. Please find attached the image and code snippet that will help you in getting the url of a record that lies in a page of the site.

    Few things to note:
    1. I have used a!recordLink() to get the unique identifier of the record being generated by Appian as part of record's url. This is because fn!urlforrecord() failed in deriving a valid value. If you have time, I would suggest trying the fn!urlforrecord and get the identifier and test the same as the usage of a!recordLink() isn't a standard approach. In case if someone is interested in this, I have tried fn!reverse(fn!split(fn!urlforrecord(ri!recordType,ri!recordIdentifier),"/"))[3] but this identifier didn't work for sites though the same worked for tempo environment(maybe I am missing something?).
    2. I have used rule!APN_getSiteUrl() but I would suggest not to use it as this rule makes use of a deprecated function and I have used it just for demonstration. Use an expression rule or constant or query rule that drives the site url specific to the environment.
    3. Implement this code as an expression rule and reuse the same so that it would be easier to replace its contents or deprecate it when Appian relases a equivalent OOTB functionality or makes changes in the functions that were used in this expression rule.
Children
No Data