Custom Safe Link Component

We have a requirement to display a link (https url)i n Appian to download file from external system and once user clicks on the link, the link should be hidden. Intent is to not allow the user to click the download link more than once. There is a reason this behavior is required. Since we need to capture the click event to be able to hide the link, a!safeLink() is not going to serve the purpose. So, we created a component plug-in to display the link which will pass the click event on which we could update variables to control the visibility of the link. The component works fine for normal external links but when we try to access address that returns a document, the new browser tab opens but it does not download the file. What we have observed is that the browser detects the connection as "not secure" although the https is used in the link. If we hit enter/refresh the tab, the document then downloads.This happens only when we test it from Appian  environment, this works fine when we test  it locally using the sail-tool. In the custom component, we are using html anchor tag for the hyperlink and an event listener is attached to it which passes the value to Appian component.

I should mention that the document download for the same link works perfectly fine when use the OOTB safeLink. But since we need to capture the click event, we are looking for ways to get the custom component working correctly. 

Please provide any insights into what might be causing this behavior and if any specific  html/JS configurations that need to be done for the link to mimic the OOTB safeLink behavior (with additional feature to capture click event). 

  Discussion posts and replies are publicly visible

Parents
  • What if the user click event were to instruct appian to systematically fetch and import the document?  That way, after the document has been imported into Appian, you can prevent the user from attempting to import the document a 2nd time.

    For example, a related action button could initiate a process that first imports the document, and then displays a user interface with a document download link.  Yes, it would be possible for the user to click that link more than once, but you could use instructions on the interfaces to explain what's happening.

    Since it's Appian that's interacting with the remote system, you can track the interaction and control whether or not to allow a second import request.  This could be by either not showing the related action after the first import, or leave the related action, but after the user clicks it, the interface they see won't show the link anymore.

Reply
  • What if the user click event were to instruct appian to systematically fetch and import the document?  That way, after the document has been imported into Appian, you can prevent the user from attempting to import the document a 2nd time.

    For example, a related action button could initiate a process that first imports the document, and then displays a user interface with a document download link.  Yes, it would be possible for the user to click that link more than once, but you could use instructions on the interfaces to explain what's happening.

    Since it's Appian that's interacting with the remote system, you can track the interaction and control whether or not to allow a second import request.  This could be by either not showing the related action after the first import, or leave the related action, but after the user clicks it, the interface they see won't show the link anymore.

Children
No Data