cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nottheOther
Level: Powered On

SharePoint history in PowerApps

Hi,

I don't know where exactly ask this question, but since I'm bulding app in PowerApps...

 

I've followed this tutorial https://www.about365.nl/2019/08/08/view-sharepoint-item-version-history-in-powerapps/ and I don't know where to find other history version properties. The ones I'm looking for is "previous value" and "new value" since, I want to show in app who change it, what was changed and what was changed to.

 

Cheers 🙂 

//edit

I've looked up to results from API and there are for every version all values that were saved. So the question is how to grab those values - for previous version, compare it and show only those fields that were changed.

//edit2

Mhm maybe filtering https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md#97-filtering gonna help?

2 REPLIES 2
Community Support Team
Community Support Team

Re: SharePoint history in PowerApps

Hi @nottheOther ,

Could you please share a bit more about your scenario?

Do you want to retrieve the record value of a specific item for previous version?

 

Based on the needs that you mentioned, I agree with your thought almost. I think the combination of PowerApps and Power Automate could achieve your needs.

 

If you want to retrieve the record value of a specific item for previous version, I think the $top=2 filter operator within the HTTP URL action path could achieve your needs.

Please check and see if the following blog would help in your scenario:

http://johnliu.net/blog/2018/5/microsoft-flow-sharepoint-trigger-on-specific-fields-changed-via-sp-h...

 

Within your Power Automate flow, add a "Send an HTTP request to SharePoint" action, Uri field set to following:

_api/web/lists/getbytitle('ListName')/items(triggerBody()?['ID'])/versions?$top=2

then the "Send an HTTP request to SharePoint" action would retrieve the current version of this List Item and the previous version of this List Item. In the last step, remove the"Respond to PowerApps or Flow" action, instead, add a "Response" action to return retrieved table value back to your app.

On your side, you could pass the retrieved version table back to your app.

Please take a try to achieve your needs based on the following blogs:

https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/

https://www.about365.nl/2019/08/08/view-sharepoint-item-version-history-in-powerapps/

http://johnliu.net/blog/2018/5/microsoft-flow-sharepoint-trigger-on-specific-fields-changed-via-sp-h...

 

In addition, if you want to only show those fields that were changed within your app, please consider take a try with the following workaround:

Within your app, save the returned result from your flow into a collection (including two records):

ClearColelct(
             ReturnedResult,
             Versionhistorydemo.Run(ThisItem.ID)
)

then add a Data Table in your app, set the Items property to following:

ReturnedResult

enable related fields within this Data Table, select the column in this Data Table, set the Visible property to following:

for column1:

If(
   First(ReturnedResult).Column1 = Last(ReturnedResult).Column1,
   false,
   true
)

for column2:

If(
   First(ReturnedResult).Column2 = Last(ReturnedResult).Column2,
   false,
   true
)

for column3:

If(
   First(ReturnedResult).Column3 = Last(ReturnedResult).Column3,
   false,
   true
)

...

...

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
nottheOther
Level: Powered On

Re: SharePoint history in PowerApps

Hi @v-xida-msft 

Thanks for the reply.

Basically I want to implement "Version History" from SharePoint list in nearly same form. [test.PNG] I just need to represent what changes has been made. 

 

And I want all history, just like in SharePoint, ex.

No 3.0 etc.

No 2.0

column1 "fail"

 

I've made change in column1 from "ok" to "fail", and in No. 2 verisoning only "column1 "fail"" that record will be shown.

No 1.0

column1 "ok"

column2 "fail"

 

//edit I hope it's understandable 🙂

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,063)