Hello,
I'm working on a SharePoint list for incoming goods. When we register a new delivery we have to compare the value for a characteristic with the value of the previous delivery. For example in below image, for the delivery of product A on 2 December I need to pull the value of the 1 December delivery. Is that possible?
Kind regards,
Hans
See updated flow design where it triggers after you add an item to the list via Power Apps.
I'm using the same list as the previous example.
Full flow below. I'll go into each of the actions.
When an item is created will fire when you add the item.
Get items is similar to the previous example, except that we use the Title column from our trigger, and also ensure we don't return the item that was just created by checking the ID.
Condition checks to see if there was a previous item with the same Product Name (length of Get items is equal to 1), and if so, update the item that was just added. The expression used is:
length(outputs('Get_items')?['body/value'])
Finally, Update item updates the current item with the value from the previous item. Note that ID and Title come from When an item is added. And the expression to get the Value Previous is:
first(outputs('Get_items')?['body/value'])?['ValueNew']
Ah, ok - I'll redesign what I posted before to work with that. Hopefully get something to you within a few hours.
Thank you @grantjenkins for your help. I tried above steps, but I receive a issue with the expression.
When we create a new item in the Powerapp, the new item in the Sharepoint list will automatically be created. After that the flow should start, pull the latest value and add this to the Previous value column.
Hopefully this is what you're after.
The SharePoint List I'm using for this example.
See full flow below. I'll go into each of the actions.
I don't have a Power Apps Form so just added Inputs into a Manual Trigger for this example.
Get items will try to retrieve the last item added with the same Product name. For my SharePoint List, the Product column is actually my Title column (just renamed it) so need to use Title in my Filter Query. It then sorts the results by Date in descending order, so it retrieves the newest entries at the top, then just returns the first one (Top Count = 1).
Create item will then take the input from the Trigger and use the following expression to retrieve the value from the previous Product entry (if one exists - could be the case where it's a new product). Also note that the internal name of my Value New column in the SharePoint List is ValueNew. The expression checks to see if the length of Get items is equal to one (an item with the same product name exists). If there is one, it gets the first item and retrieves the value from the ValueNew field. If no items returned, then it just sets the value as null.
if(equals(length(outputs('Get_items')?['body/value']), 1), first(outputs('Get_items')?['body/value'])?['ValueNew'], null)
@grantjenkins, we use a Powerapps app to add a row.
@Rapaille Makes more sense 🙂
How are you going to be adding rows to your SharePoint List? Are you adding it manually and want a flow to then calculate the last value, or are you adding a row directly via Power Automate?
@grantjenkins, thanks for your answer. The Excel table was only as example.
I do indeed use a SharePoint list, so I'm looking for a way to pull a value from the item of same product.
How are you adding the data to your Excel Table? Just trying to understand how your flow will work, etc. since you mentioned you're using a SharePoint List.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1