Number of revisions done with a period of time

Can anyone provide me AML script to retrieve the number of times documents have been revised within a specific period of time?

Parents
  • Hello,

    This can be broken down into a couple different questions. The first is how to return multiple versions of the same item. By default, an AML query will return only the most recent generation of an item that matches your query parameters. You can override this functionality by specifically including the generation property in the body of the AML request as seen in the example below.

    <AML>
        <Item type="Document" action="get">
            <item_number>My Document</item_number>
            <generation condition="gt">0</generation>
        </Item>
    </AML>

    By getting all of the items with a generation greater than 0, we're getting every generation of My Document. The next problem to solve is how to get only the generations that were modified in a specific time-span. For this we can use similarly use a condition on the modified_on property. The sample request below will get all of the revisions of this document that have been made since the beginning of 2019.

    <AML>
        <Item type="Document" action="get">
            <item_number>My Document</item_number>
            <generation condition="gt">0</generation>
            <modified_on condition="ge">2019-01-01</modified_on>
        </Item>
    </AML>

    This works well enough if we only care about a range from a previous date to now, but we may also want to be get all of the revisions within a specific range of two dates. To do this, we can use an <AND/> property in our request to search on two different dates. The sample below shows how to get only the revisions of the document that were created in the month of January 2019 by using two different conditions.

    <AML>
        <Item type="Document" action="get">
            <item_number>My Document</item_number>
            <generation condition="gt">0</generation>
            <AND>
                <modified_on condition="ge">2019-01-01</modified_on>
                <modified_on condition="le">2019-01-31</modified_on>
            </AND>
        </Item>
    </AML>

    Chris

    Christopher Gillis

    Aras Labs Software Engineer

Reply Children
No Data