Showing results for 
Search instead for 
Did you mean: 
New Member

Compare Sharepoint Lists, get maximum/minimum value per each task and update item.

Hi everyone,

I'm new in Flow and I've been trying to figure out how to make my flow works. I saw some videos and tried some things, but it didn't work. Maybe someone can show me the correct steps.


So, I have two sharepoint lists.

List A contains three columns. Task ID, start date and end date.
List B contains four columns. Task ID, Worker, start date and end date.

In list B, I can have more then an row per task because I can have more than one worker on a task.


What I have to do is:


1. Thrigger when an item is created or modified in list B
2. Get items from list A
3. Filter the task ID and compare it to the task ID of the row that was created or modified.
4. Create an array of list B (the list that I created or modified items) in the start date column and get the minimum value (let's call it start_date_min) and another array in end date column and get the maximum value (let's cal end_date_max).
5. A condition for comparing the task ID in list B that was created or modified with the task ID in list A.
6. If the task ID matchs, update the start date with start_date_min and end date with end_date_max


I had difficulties with step 3 and 4.


Maybe one of you could point me in the right direction?



Super User
Super User

Hello @ThiagoPais 

Let me see if I understand your need correctly.

When a B item is modified, you have to check whether or not the start date and/or the end date is outside the period specified by the related A item and then update the A item accordingly. Example:

A item starts 2020-01-01 and ends 2020-01-31

B item starts 2020-01-24 and ends 2020-02-10 <- end date was modified in B


A now has to be updated to have an end date = 2020-02-10 - correct?

Kind regards, John

Hello @JohnAageAnderse.

I'm sorry for the delay. I hadn't seen your message before.


Not exactely. Let me explain:


Sharepoint A is a list of tasks about a project. And I have the start date and end date columns about the task (a row).

Sharepoint B is a sublist of Sharepoint A. It is a list where I select the people who will work on a task and enter the start date and the end date. But I can have more than one person on a task and on different days.


For example:

Worker 1 will start on 11/08/2020 and end on 12/08/2020

Worker 2 will start on 12/08/2020 and end on 12/08/2020


What I need? In Sharepoint B, group the same tasks selecting the minimum start date and the maximum end date and update this info in sharepoint A in the start date and end date columns respectivaly. But matching the tasks of course.

And I need this when creating a new row or when modifying an existing one.


Do your understand?


Thanks if you can help.


My best regards.






Helpful resources

Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (64,390)