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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trying to get version ...
Power Apps
Answered

Trying to get version history of SharePoint list item

(0) ShareShare
ReportReport
Posted on by 90

Basically I have a multi screen app where on my Edit screen which displays the list form for a particular item, I have a history icon. On clicking the history icon, it should open the "history screen" that would display version history for that particular item. 

 

Originally, I wanted to create a horizontal gallery and record a "repeating section" (Infopath term) of specific fields like Modified, Modified By etc. but I have no idea how to do that.

 

I started following this link: https://www.about365.nl/2019/08/08/view-sharepoint-item-version-history-in-powerapps/

Got stuck at the "Transforming Data in Powerapps" section. I have no clue how to call the flow from the powerapp to display it like it is shown in that link. Please help!

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Mikello-6626 ,

     

    I have looked into that blog, so if you have created the Flow correctly, below are the steps you need to follow up:

     

    1\ Set OnSelect of the "View history" icon to:

    Set(
     varHistory,
     Versionhistorydemo,Run(ThisItem.ID).history
    );
    ClearCollect(
     colHistoryTemp,
     Split(
     varHistory,
     "|"
     )
    );
    ForAll(
     colHistoryTemp,
     Collect(
     colHistory,
     {
     Date: DateTimeValue(
     First(
     Split(
     Result,
     ";"
     ).Result,
     "nl-NL" //use your own language code
     ),
     Version: Last(
     FirstN(
     Split(
     Result,
     ";"
     ).Result,
     2
     ).Result
     ).Result
     }
     )
    );
    Clear(colHistoryTemp);
    Navigate(VersionHistoryScreen)

     

    2\ On VersionHistoryScreen, you have a Gallery, set Items of the Gallery to:

    Sort(
     colHistory,
     Date,
     Descending
    )

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Mikello-6626 Profile Picture
    90 on at

    @v-jefferni Here is my setup for powerautomate flow. I renamed the blocks to the exact name as the blog....and also the flow to "Versionhistorydemo".

    Mikello-6626_1-1617291555921.png

     

    I only selected 

    • items(‘Apply_to_each_version’)['Modified’]
    • items(‘Apply_to_each_version’)[‘VersionLabel’]

     

    Mikello-6626_5-1617292313412.png

     

     

    In powerapps, I select the versionhistorydemo flow for the history button and OnSelect, when I type this code, it doesn't even recognize the ThisItem.ID in the Run() function. On my "Edit Screen", I have a history icon, which upon click, should take me to the page...like in the blog (last image). I wanted to skip the gallery item view option, since user will only want to see the History of the item they are viewing.

    Mikello-6626_4-1617292188537.png

     

    Also, I am unclear how the below screen was set up? Is this a horizontal gallery with 3 text labels? Is there a default for this text? Any help is appreciated

    Mikello-6626_0-1617298102904.png

     

     

     

     

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Mikello-6626 ,

     

    For the question of appending the Flow on the button, you need to add it from clicking the Flow in below pane after the Flow has been created successfully. 

    v-jefferni_0-1617327730068.png

     

    Please note that once appending the flow on the button, all formulas of OnSelect of the button would be replaced with only the Flow.Run function, so you could add a single button and use its OnSelect for coping and pasting Flow.Run functions.

     

    For the second question, it could be a vertical Gallery like said in the blog, but if it's only for reading, you could use a Data table Control as well, you will be able to display column names and values in it easily.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Mikello-6626 Profile Picture
    90 on at

    @v-jefferni I don't think I explained it well. I have an Edit form on an "Edit screen". I have a button on that screen that would call the History flow and present that second screen. I did all that, create flow, add flow to form. However, the blog post is based on a gallery screen. I am doing an Edit form screen. 

    Versionhistorydemo.Run(ThisItem.ID) - ThisItem.ID does not recognize. Are you able to reproduce this issue?

    Mikello-6626_1-1617338224333.png

    Mikello-6626_2-1617338265549.png

     

     

     

    I am very new. How is the value showing on second screen? What is the input type, default value.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Mikello-6626 ,

     

    Please check the Item property of the Edit Form (assuming it's Gallery.Selected), copy and paste it to replace ThisItem in my post.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • jan_mac Profile Picture
    106 on at

    Good day people! Just wanna add to this thread, I too followed the same tutorial no problem in my part it is working as intended however I am trying to make the contents of sharepoint version history to be also available in powerapps perhaps a redirection when a version is selected. Thanks for any advice.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard