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 Apps / Possible to pull info ...
Power Apps
Unanswered

Possible to pull info from record version history?

(0) ShareShare
ReportReport
Posted on by 264

Hello, I've looked everywhere for a solution to what I'm trying to achieve with no solid yes or no that it can't be done.  I have a user login list where I have patch set up to create/modify the record for the respective user logging in.  This has worked flawlessly. However, I also have a notification ribbon set to flash a welcome message at the top of the app when the user logs in.  I'm trying to get the previous version of the records modified date to pop up with the notification so the user knows the last time they logged in.  Here's my current code with the PreviousLogin being a variable I've set up with the data I'm trying to pull.

 

Notify( "Hello " & Office365Users.MyProfile().GivenName & ", your last login was " & PreviousLogin, NotificationType.Success, 4000)

 

Below is the actual data in SharePoint with the info I'm trying to pass into PowerApps.  My question is, can I pull this data into PowerApps, and how do I do it?   

 

Version History.PNG

 

 

Categories:
I have the same question (0)
  • MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at
    Hey @forbudt4u

     

    you can get the SharePoint version history by making a SharePoint HTTP Rest API Call:
     
    https://<tenantname>.sharepoint.com/sites/<sitename>/_api/web/lists/getbytitle('<listname>')/items(<ItemID>)/versions
     
    unfortunatly you don't have a build in function to execute this Call from Power Apps, but using the Power Automate SharePoint Action "Send an HTTP request to SharePoint" (Here is a references: Working with the SharePoint Send HTTP Request flow action in Power Automate | Microsoft Docs).
    So you would need to let the user maybe click on a button before accessing the app (like having a "Welcome Page" before your actual app to first trigger the Flow and afterwards changing the screen).

     

    Your Flow could look like this:

    Image 646.png
    In "PowerApps (V2)" you define a number input "ID" to get the correct item from the SharePoint list (maybe in Power Apps oder Power Automate doing a lookup for the correct item, we need the internal unique SharePoint list item ID). Next use the SharePoint - Send an HTTP request to SharePoint action:

     

    Image 647.png

    Site Address: Your SharePoint Site Collection
    Method: Get
    URI: _api/web/lists/getbytitle('<InternalListName>')/items(@{triggerBody()['number']})/versions


    The compose is used to show me the output using a formular:

     
    outputs('Get_Version_History')?['body/d/results'][1]?['Created']
     
    The [1] always makes sure to get the second item from the top (0=first item in an array; 1 = second item in an array...). Finally we can give a respond to Power Apps giving the LastLogin Timestamp:

    Image 648.png

     

    In Power Apps on your Button - OnSelect you configure:
    Set(varLastLogin,'PowerApps-GetSPVersion'.Run(2))
     
    (I used a fixed value "2" for my ID in the list, you maybe need to make it dynamic).

     

    Setting the value to a label:

    Image 649.png

    varLastLogin.lastlogin

     

    It's a workaround, but works on my side. Maybe it helps you, I don't know any form to directly trigger a SharePoint Rest. There is a Idea for this, you can maybe vote for: Native SharePoint HTTP (Rest) Action for PowerApps - Power Platform Community (microsoft.com)



    Best regards
    Marvin

     

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.
  • forbudt4u Profile Picture
    264 on at

    @MarvinBangert  

     

    Brilliant solution!!

     😁 Just kidding...  sure you mistakenly replied.  

  • MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at

    @forbudt4u 

    sorry, I wrote a long answer but somehow the forum did not let me send this, seems like the code sample had some problems. With the "Test" I just tried to check if I could even comment anything 😅 I updated my post, hope this helps, I left out the code samples formatting 😊

  • forbudt4u Profile Picture
    264 on at

    @MarvinBangert  

     

    Not a problem, figured something funky happened.  

     

    Just amazes me that data can physically be seen in SharePoint, but PowerApps can't see it/pull it.  I'll try the flow and see if I can get it to work the way I want.  If not, I may just make the Previous Login be a pop-up at login rather than part of the notification.  That way I can just have an OnSelect command patch the current login record with the static date info and that's what will display as the last login when they login again.  

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard