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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / daily update of list i...
Power Automate
Answered

daily update of list items with 'days until due'

(0) ShareShare
ReportReport
Posted on by

Suppose I have an MS List of 10 items with 4 columns: title (string), due date (date formatted mm/dd/yyyy), days til due (number), task lead (person name). I want to automate two tasks. One is a daily task, the other is a one-time task: 

 

Daily task:

-for each item in the list, update 'days til due' field (due date minus today) as an integer

 

One time task:

- for each ‘due date’ subtract 45 days to produce T-45 date

- put placeholder T-45 meeting on Outlook calendar 

- send courtesy email to person in the ‘lead’ column as a heads up.

 

I have reviewed similar topics but I have not found a single coherent explanation of how to do this. When I try dynamic content, the fields I want never seem to be there, and I don't understand the choices that I see.

 

Thank you!

Categories:
I have the same question (0)
  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Your daily task and One-time task should be deployed to two flows.

    vwenjuanmsft_0-1680856548775.png

    1. Create a Scheduled flow to run one time each day.

    Below is function we will use to calculate days till due. Remember to change time zone to your place.

     

    first(split(dateDifference(formatDateTime(convertFromUtc(utcNow(),'China Standard Time'),'yyyy-MM-dd'),formatDateTime(item()?['Duedate'],'yyyy-MM-dd')),'.'))

     

     

    vwenjuanmsft_1-1680857139635.png

     

    2. As for One-time task, advice is to set a manual flow. Below are functions used in my test. You can change time for meeting whenever you like.

    addDays(item()?['Duedate'],-45)
    startOfDay(outputs('Compose==T-45'))
    addHours(startOfDay(outputs('Compose==T-45')),1)

    vwenjuanmsft_2-1680858084875.png

     

    Here are my result:

    vwenjuanmsft_4-1680858260260.png

     

    vwenjuanmsft_3-1680858245572.png

     

    Best regards,

    Wenjuan Zou

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    on at

    Thank you Wenjuan Zou. I was on the right track. Your solution seems correct, but I am getting an error:

     

    Unable to process template language expressions in action 'Update_item' inputs at line '0' and column '0': 'The template language function 'dateDifference' expects its second parameter to be of type string. The provided value is of type 'Null'.'.

     

    I checked to make sure my second parameter in the dateDifference function (my end date) was a string, but I still get the error. Here is my second parameter:

     

     

    item()?['T-0'])

     

     

    Part of my problem is I do not understand that syntax. Since it is already a string in the correct format, I did not think I needed to recast its format.  'T-0' (a string, MM/dd/yyyy) is the name of my due date field 
     
  • Community Power Platform Member Profile Picture
    on at

    By the way, 'T-0' (a string, MM/dd/yyyy) is the name of my due date field 

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

    Hi @Anonymous ,

     

    You may refer to this document to convert your parameter to a string:

    Reference guide for expression functions - Azure Logic Apps | Microsoft Learn

     

    Best regards,

    Wenjuan Zou

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard