Discussions

Expand all | Collapse all

How can I use the revision history of a file attachment in a formula for another field?

  • 1.  How can I use the revision history of a file attachment in a formula for another field?

    Posted 10-31-2016 15:39
    I want to use the revision number of a file attachment in the file name of the attachment, so maybe a "last revision number +1" in creating the file name for the attachment.  How do I access the revision number in a qb formula?


  • 2.  RE: How can I use the revision history of a file attachment in a formula for another field?

    Top
    Contributor
    Posted 12-07-2016 05:09
    The API Guide contains an appendix describing the file attachment path, and specifically how to access various revisions: https://help.quickbase.com/api-guide/index.html#filemanagement.html


  • 3.  RE: How can I use the revision history of a file attachment in a formula for another field?

    Posted 04-17-2017 18:45
    has anyone solved this yet?  I have the same question.  looking at the API guide, it would be nice fi there were a formula for VID like DBID, but that isn't the case


  • 4.  RE: How can I use the revision history of a file attachment in a formula for another field?

    Top
    Contributor
    Posted 04-18-2017 06:38
    I know you can reference the version # when you are creating a formula field to read the value of the file attachment.

    URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e240/v0"

    Not sure about pulling the number of revisions.

    Maybe consider using a child table as the "Document" storage location, and then you can count the number of child documents, and have all sorts of control of revisions that way.


  • 5.  RE: How can I use the revision history of a file attachment in a formula for another field?

    Posted 07-05-2017 13:47
    I'm somewhat ignorant to html, how does the v0 become the actual version # in this example?  wouldn't it always show as v0 as in quotes?


  • 6.  RE: How can I use the revision history of a file attachment in a formula for another field?

    Top
    Contributor
    Posted 04-18-2017 11:32
    The version information of a file attachment is only available through the API_DoQuery method with the format structured (ie &fmt=structured) being requested.

    <field id="6" field_type="file" base_type="text">    <label>file</label>
      <nowrap>0</nowrap>
      <bold>0</bold>
      <required>0</required>
      <appears_by_default>1</appears_by_default>
      <find_enabled>1</find_enabled>
      <allow_new_choices>0</allow_new_choices>
      <sort_as_given>1</sort_as_given>
      <carrychoices>1</carrychoices>
      <foreignkey>0</foreignkey>
      <unique>0</unique>
      <doesdatacopy>0</doesdatacopy>
      <fieldhelp/>
      <max_versions>3</max_versions>
      <see_versions>1</see_versions>
      <use_new_window>1</use_new_window>
    </field>

    If you need access to the version information you have to use script or mockup your own versioning system using a child table as Matthew suggested.