web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

how many days?

(0) ShareShare
ReportReport
Posted on by 186
Spoiler (Highlight to read)
 
 

your help please

I created a flow, with 9 cases
NOT STARTED
REJECTED
COMPLETED
IN PROCESS PO DISPATCH
...
sharepoint scenario

now they ask me to calculate how many days pass between each case
Example days between NOT STARTED and IN PROCESS PO DISPATCH

in the flow, within each case, I have updated the list to record the modification date

but I create a loop, because the flow is executed again

try to send the modification dates to another sharepoint list, but the id generates problems

any ideas?

 

https://drive.google.com/file/d/1Frfxu1S7ryRapv9x4y9Jv62ZJI4vPm97/view?usp=sharing

Image

image

 

thank you

Categories:
I have the same question (0)
  • RobElliott Profile Picture
    10,525 Super User 2026 Season 1 on at

    Instead of doing this with Flow you could add a calculated column to your SharePoint list to calculate the difference between the dates, e.g Process PO despatch minus NotStarted.

    Rob
    Los Gallardos

  • javierz Profile Picture
    186 on at

    this option already try

     

    Columns calculates works fine, but users review the documents and go to the list to change it's state

    the flow is activated and adds the date of the modification, in another column

    as seen in the attached image 2

    at this moment a loop is created

    I'm trying another option by removing the swictch and adding conditions for each state and then another condition that validates if the field where the date of the modification is empty

     

    Capture 2

     

    https://drive.google.com/file/d/1K7DKAe0g6PwmMgB7r-KNY03cD1LxgA9F/view?usp=sharing

     

    capture 3

    https://drive.google.com/file/d/1WjBaeSu0nj55gWpZdINykrGADRnndyK5/view?usp=sharing

     

    what do you think?

     

  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @javierz ,

     

    Could you share more details on your scenario?

     

    I guess that you have a Choice column for the Status, and a date column for the Modified date time.

     

    Do you want to calculate the days between the modified date of two status? Besides, it looks like the modified date time column will be updated whenever an item is modified.

     

    If so, please check if flow likes below will be a reference for you.

     

    After the trigger “When an item is created or modified”, get item, then use a Compose to get the DueDate.

     

    Then update item action to update the DueDate with the following function:

    Adddays(utcnow(),7,’yyyy-MM-dd’)

    Then Get item 2, and Compose 2 to get the current DueDate.

     

    Add Compose 3 with the following function to get days between two dates.

    div(sub(ticks(outputs('Compose_2')),ticks(outputs('Compose'))),864000000000)

     

    Note: When you are using the trigger When an item is created or modified and Update item on the same list within a flow, an infinite loop will be caused.

    1.PNG

     

    Best regards,

    Mabel

     

  • javierz Profile Picture
    186 on at

    Hello
    Thanks for the help
    a little more information, the idea is to calculate the dates between the status jumps
    I have 8 jumps, and you want to see how many days each user takes to do the process (image 1)

    I am testing with the flow of image 2, sending the dates to excel and using = DATEDIF ()

    but I have doubts if it is the best way or can be improved

     

     

    Image 1

    switch.JPG

     

    Imagen 2

    days.JPG

    regards

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 246 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 176

#3
Haque Profile Picture

Haque 157

Last 30 days Overall leaderboard