previous version of a Document in SAIL

hi all,
do you know how in SAIL can I show, for a given DocumentID, all its previous versions?
many thanks

OriginalPostID-261973

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    Hi Francesco,

    The work around for your approach is that first you need to save each document individualy i mean don't let appian to create document versions.
    Save all the related document ids in database and keep a reference column so that you can pull all the related document ids
    Then you need to construct a URL to download the document with obtained doc id's. The URL for downloading documents can be seen below

    forum.appian.com/.../106162

    You can get "forum.appian.com/.../" using rule!APN_getSiteUrl() or you can keep it in a constant and this should be changed from environment to environment witn new URL

    And keep the "doc/"" in a appian constant

    Now construct the URL in a expression rule say getDocumentVersions() which takes document id as input. Code for the rule will be in below format
    rule!APN_getSiteUrl() & doc/ & documentId

    Now you can use apply() to iterate newly created getDocumentVersions() rule for document ids obtained from DB

    Hope this will help you.
  • 0
    Certified Lead Developer
    Adding to the above, since you have doc id's you can use below code in an expression and iterate it.
    a!linkField(
    label: "",
    links: a!documentDownloadLink(
    document:
    )
    )
    This will be the better approach for creating document download link
  • hi @akkramanir,
    thanks for suggestion, but that's exactly what I was trying to avoid with my question :)
    in my use case I already have a relationship between different documents, so I don't want to add different rows in the DB just for the version change.
    what I need is to use the Appian versioning, and when a user select a document from a grid in SAIL, to show somewhere else (in another grid maybe) the list of previous version for that document.. but without having different documents as version
  • 0
    Certified Lead Developer
    Hi Francesco,

    There is a plugin in shared components which gives metadata of a document please refer the below link.
    forum.appian.com/.../summary

    The only problem is that you cannot download the earlier versions of the documents since the old versions returned by the plugin have the same doc id.

    I had the same scenario in my project and we opted for database to manage document versions. Lets see what other practitioners say.