Clicking on linkfield to open URL and also save Auditing data into database

Certified Associate Developer

In our project, we have a requirement to audit the link clicks from Appian Page.

We would like to store the user, datatime, link Clicked etc. information in a database table and also same time open the URL.

 OR

If Google Analytics link tracking can be used here? If anyone used it?
support.google.com/.../1136920

 

=a!linkField(
  label: "Links",
  links: a!safeLink(
    label: "Company web site",
    uri: "http://www.appian.com"
  )
)

I do not see any option to make DB call to save to database?


  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Unfortunately, there isn’t a straightforward way to achieve this directly in Appian, so I used a combination of Web APIs, Integrations, and JavaScript to make it work.

    Step 1:

    Use a Web API in your save link and pass the necessary link information as a parameter.

    Step 2:

    Within the Web API:

    • Call an Integration that writes the data to the database.
    • Include JavaScript logic to launch the target page.

    Below is a sample outline of the logic used.

    "<html>
    <script>
    window.open('" & www.google.com & "', '_self')
    </script>
    <body>
    'Redirecting to target system'
    </body>
    </html>"





  • 0
    Certified Lead Developer
    in reply to Sravanteja Gadikota

    This is a very old topic to resurrect, but what's interesting it how both of its subjects are still relevant: auditing of user actions, and multi-action triggers via a single click.

    1. Auditing of user actions has been discussed quite a bit recently. A forum search of the past 18 months should get some great results.

    2. The modern standard of redirects require no javascript. tl;dr - an API response with status code 302 and proper headers is perfect for "single click to do XYZ" in a lot of use cases, particularly in Chrome. For example, I used the redirect trick to allow another system to direct their users to an Appian API, which then used some context in the URL and loggedInUser() results to redirect users to the appropriate place inside Appian. 

Reply
  • 0
    Certified Lead Developer
    in reply to Sravanteja Gadikota

    This is a very old topic to resurrect, but what's interesting it how both of its subjects are still relevant: auditing of user actions, and multi-action triggers via a single click.

    1. Auditing of user actions has been discussed quite a bit recently. A forum search of the past 18 months should get some great results.

    2. The modern standard of redirects require no javascript. tl;dr - an API response with status code 302 and proper headers is perfect for "single click to do XYZ" in a lot of use cases, particularly in Chrome. For example, I used the redirect trick to allow another system to direct their users to an Appian API, which then used some context in the URL and loggedInUser() results to redirect users to the appropriate place inside Appian. 

Children
No Data