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 Platform Community / Forums / Power Automate / Forms Flow and Azure D...
Power Automate
Answered

Forms Flow and Azure DevOps staggered target date

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have created a form that feeds to flow which creates a work item with multiple child work items. I have it set so you enter a target date in the form that gets populated in all the created work items. I would like just the target date entered to be in the first parent work item and have the target dates for the child work items (7 in total) to have a another week added to that date per work item. So if target date for parent = 1 week, child 1 = 2 weeks, child 2 = 3 weeks, etc.

Categories:
  • jhall Profile Picture
    636 on at

    Depending upon what you're writing the form in might determine the easiest method for calculating a "Date + 7" value per child.

     

    Regardless, in Flow you can take a String variable that holds a date and use the addDays(stringDate, numberOfDays) function to add seven days.  So if you received a string Date/Time as an input (or pulled by a query), then using this function will do it for you.

     

    If I were doing the Form in PowerApps, then I personally would probably do this inside the application.  However, for iterating through a list of child items in Flow where the data is already written to SharePoint, then you can use the Initialize Variable step to save the original task's date, use the SharePoint GetItems step to grab all of the children, then do an ApplyToEach step to loop through each child, use the Set Variable step to add 7 to the original date, then the Update Item step to write the new value for the child's date.

     

    Italics below are the values you would change in each step to reflect your own list:

     

    • Initialize Variable| taskDate: parentDate
    • Get Items | Filter Query: parentID eq firstTaskID | Order By: childOrder asc
    • Apply To Each| Value
      • Set Variable| taskDate:addDays(taskDate,7)
      • Update Item(completeTaskByDate: taskDate)

    I'd still likely approach this at the Form (if possible), but this could be done pretty easily post-write.

  • TylerH Profile Picture
    Microsoft Employee on at

    I'd like to do this in flow. i don't quite understand how thats done still with the addDays(stringDate, numberOfDays). curently i'm inputting this into flow. @body('Get_response_details')?['rb09f248d95c2489dbc31ae9c968cf880'] which is pulling from the forms 'Target Date' date picker. Would i change the expression to addDays(@body('Get_response_details')?['r6c96f6deb9664dfb8e6e53b5bc0d93c6'], +7)     to get the target date +7?  Also, If i wanted to subtract dasy would i just use a -7?

     

    Thanks for the help!

  • jhall Profile Picture
    636 on at

    Yes.  My guess would be that you can do it that way, but you might test using a variable assignment first so you can look at the exact result and adjust it if necessary to proper date formatting.  

     

  • Verified answer
    TylerH Profile Picture
    Microsoft Employee on at

    Looks like these were the expressions i was looking for.

     

    +5 days

    addDays(body('Get_response_details')?['r6c96f6deb9664dfb8e6e53b5bc0d93c6'], 5)

     

    -5 days

    addDays(body('Get_response_details')?['r6c96f6deb9664dfb8e6e53b5bc0d93c6'], -5)

    Thanks for your help!!!

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard