I am attempting to use Power Automate to query the history from a SharePoint list item and pull that into my PowerApp.
I found several tutorials that are very partially put together. It appears I have 2 options, 1 is to convert this into a string as demonstrated here View SharePoint item version history in PowerApps - About365. This works well for pulling in just the person who did the edit, when, and what version. However, I want a lot more information than that.
I was able to just export, what appears to be, JSON that is returned from the api call. This gave me the ability to see all the fields that are returned. Unfortunately, not every field is returned with every historical item.
For example, the ['Assigned_x005f_Individual']['LookupValue'] may or may not exist.
When I run the query, if there is no Assigned Individual, than an error returns "InvalidTemplate. Unable to process template language expressions in action 'Append_to_string_variable' inputs at line '0' and column '0': 'The template language expression 'items('Apply_to_each')['Assigned_x005f_Individual']['LookupValue']' cannot be evaluated because property 'LookupValue' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'."
I have tried, "if(empty(items('Apply_to_each')['Assigned_x005f_Individual']['LookupValue']),"",items('Apply_to_each')['Assigned_x005f_Individual']['LookupValue']) with no luck. In excel I have iferror(), I assume there has to be some way to handle these. Some type of, if this field doesn't exist than just return blank.
Ultimately, my goal, without using premium objects, is to get this back into PowerApps as a string that I can then split up into a collection and display in a gallery but I'm just stuck here. If I just use the 3 fields mentioned in that tutorial, I can get the gallery working, but users really want to know, WHAT was changed, not just that it was changed by somebody.


Report
All responses (
Answers (