Rich Text Item link property to use two services simultaneously

Certified Senior Developer

Hi Devs,
I want to use to services in my rich text part, in this on the click of the link and the csv document will be downloaded in the system as an export file,
Simultaneoulsy I want to start the process on that click only to delete that csv document that is created internally by appian, so that my app does not pile up with time in the future
Attaching the snip for your reference:





  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Where/when/how is your Export CSV generated?  One trick I've used in my implementations, particularly for on-demand generated documents, is to have a timer node after the generation node, lasting several hours, and after it expires the generated file is deleted.  The users are warned in the UI that they have a relatively limited amount of time to download the exported file.

    If the ones you're dealing with are generated automatically (i.e. overnight) then you could potentially implement a 2-click solution.  I.E. at first the download link could be grayed out and the user sees a separate link next to it saying "Click to mark as seen and enable download"; that click would start a process that can delete the document after a (long) timer has expired, and after that click has been completed, the download link can be enabled for the user.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Let me explain you through the interface,

    The above interface is before i click search
    Now, I click search and download:

    There will be a rich text to download the generated csv.

    As you can see above, in the backend, the folder in which i am pointing to, contains all the csv files, which will pile up one day and slow down the system.
    So, I want a solution to delete the contents of this folder after 1 day of the creation of the file.
    I am creating this csv from a database view as a source.

  • 0
    Certified Lead Developer
    in reply to saifalikhan13

    Are the CSVs generated by a process model?  If so, you could put a timer node at the end of the process which, after it expires, deletes all documents generated in that model.  Alternatively you could build a whole separate process model which runs nightly, gets all documents in the folder, and deletes documents older than X days for example.  The choices are relatively limitless here depending on your needs.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    This CSV is genereted by the interface code itself, data source is view
    I created the PM, for implementing the cleanup
    But i am not able to find a service to clean the contents of that folder
    I know to set a auto timer, but not able to get the right service to delete the created csv files in the application at the backend

  • 0
    Certified Lead Developer
    in reply to saifalikhan13
    But i am not able to find a service to clean the contents of that folder

    You merely need the "delete document" smart service in a process model...

    That is what I was trying to suggest above:

    Alternatively you could build a whole separate process model which runs nightly, gets all documents in the folder, and deletes documents older than X days for example. 

    To clarify, in the first node you'd use a rule to grab all documents from the folder (since it looks as if they're all stored in the same folder).  Then loop over all the documents and return only documents older than your chosen threshold, to be stored in a PV array.  Then loop over the "delete document" smart service for each of those document IDs.

Reply
  • 0
    Certified Lead Developer
    in reply to saifalikhan13
    But i am not able to find a service to clean the contents of that folder

    You merely need the "delete document" smart service in a process model...

    That is what I was trying to suggest above:

    Alternatively you could build a whole separate process model which runs nightly, gets all documents in the folder, and deletes documents older than X days for example. 

    To clarify, in the first node you'd use a rule to grab all documents from the folder (since it looks as if they're all stored in the same folder).  Then loop over all the documents and return only documents older than your chosen threshold, to be stored in a PV array.  Then loop over the "delete document" smart service for each of those document IDs.

Children
No Data