Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
We are using a!safelink to provide provision to download a file using presigned URL. The requirement is we need to store which user clicked on the link and when in audit table, but
as in the safelink there are no saveinto parameter . I tried multiple other ways but all in vain.
I am unable to find a solution, where on a single click user able to navigate using presigned url as well as in backed it writes to audit.
please advise what to do that in this case and any work around we can do to achieve the requirement.
Thank you in advance
Discussion posts and replies are publicly visible
Since a!safeLink doesn't support saveInto, we implement a two-step download process - first click logs the audit, second click downloads the file.Have a look at sample code for your reference:
a!localVariables( /* Track whether the initial link has been clicked */ local!linkClicked: false, local!presignedUrl: "www.google.com", { a!linkField( links: { /* STEP 1: Initial link that triggers audit logging */ a!dynamicLink( label: "Click to Download", value: true, saveInto: { /* Set flag to show the actual download link */ local!linkClicked, /* Write audit record using a!writeRecords */ /*a!writeRecords(records: {}, onSuccess: {}, onError: {})*/ }, showWhen: not(local!linkClicked) ), /* STEP 2: Actual download link shown after audit is logged */ a!safeLink( label: "Download Now", uri: local!presignedUrl, /* Only show after the first link is clicked and audit is logged */ showWhen: local!linkClicked, openLinkIn: "NEW_TAB" ) } ) } )