web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get changes is retriev...
Power Automate
Unanswered

Get changes is retrieving incorrect SinceVersionLabel

(0) ShareShare
ReportReport
Posted on by 24

I am using the "When an item or a file is modified" SharePoint trigger and adding "Get changes for an item or a file (properties only)" action. The SinceVersionLabel is not the previous version label but the one prior to that. 

 

SharePoint Library version settings: 

rkapofu_0-1662492860712.png

Power Automate Flow:

Trigger condition is @equals(triggerOutputs()?['body/{IsCheckedOut}'],false) to prevent triggering the flow each time a document is modified and only when someone checks in a new version, minor and major. 

rkapofu_1-1662493282944.png

 

If I compose "Get changes..." the since version label on the example below should be 2.1, but it is showing 2.0.

rkapofu_2-1662493423344.png

My tests have shown...

1. When I edit a field in the view form, it will show the correct since version number when I check in after I have finished updating the properties. For instance the above example would have shown since version label 2.1 instead of 2.0.

rkapofu_3-1662494128896.png

 

2. When I click "Edit all" properties and then "Save" the since version number shows as the prior to previous number in the flow when I check in the document. This will produce the incorrect version number like the image shown above, which was 2.0.

rkapofu_5-1662494203566.png

rkapofu_6-1662494216405.png

 

Is this a bug?

 

Thank you!

 

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @rkapofu,

     

    Just to double check. Did you set the Include Minor Versions to yes under the advanced options of the Get changes for an item or file (properties only) action?

     

    And what expression or value did you use in the Since field?

     

    This expression should work with both minor and major version numbers:

    if(equals(indexOf(triggerOutputs()?['body/{VersionNumber}'], '.'), -1), add(int(triggerOutputs()?['body/{VersionNumber}']),-1), add(float(triggerOutputs()?['body/{VersionNumber}']),-0.1))

     

    includeminorversions_setup.png

  • rkapofu Profile Picture
    24 on at

    I am using minor versions. The Since field is below 

    rkapofu_0-1663015670700.png

    I tried the expression you provided. It works when going from major to minor version. When using minor to major or major to major, it fails and always produces a ".9" value at the end of the previous version number. When publishing from minor to minor version, it only works when the version numbers are less than ".9". If it goes above that then it starts pulling in incorrect since version numbers. Such as if the until version number is 9.10, the previous version is 9.0 instead of 9.9.

  • rkapofu Profile Picture
    24 on at

    Just want to point out that document libraries operate differently between viewing the details and updating one field vs click on the "Edit All" properties and then clicking Save. The first generates the correct version numbering, the second causes the jump in version numbers. 

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @rkapofu,

     

    Thanks for spotting that minor versions above .9 not working error. I updated that expression:

    if(equals(indexOf(triggerOutputs()?['body/{VersionNumber}'], '.'), -1), add(int(triggerOutputs()?['body/{VersionNumber}']),-1), concat(split(triggerOutputs()?['body/{VersionNumber}'], '.')[0],'.',add(int(split(triggerOutputs()?['body/{VersionNumber}'], '.')[1]),-1)))

     

    I have not seen that it skips minor versions while bulk updating properties in the library. I will double check that as well.

  • rkapofu Profile Picture
    24 on at

    It's the output from Get changes in the Since and Until Version ID, sorry misspoke on that. It does intervals of 512. If I update the properties in the view details pane, the version ID goes up by 1. If I do it when using "Edit All", it goes up by 512. In the image above of the output from Get changes in my original message, you'll see the jump. I could use the versionID field to adjust for -1, but it's not consistent either.

     

    I'll try your edits and see if that changes things. Thank you for helping

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @rkapofu 

     

    {VersionNumber} property from the trigger action should be the same as the VersionLabel property, which is 0.1, 0.2, 1.0, 1.1, etc.

     

    The VersionId is a number. With minor versions it would go up by 1. So 0.4 would be VersionId 4. With major version it increments by 512, like you already mentioned.

     

    Combine the two and for version 1.2 you would get VersionId 514 (512 + 2). 

     

    It should also be possible to determine the previous version with the VersionId field as well. You can probably work that out as well with some float, div and mod functions 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard