Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Suggested answer

Create a Spreadsheet based off of column date

(0) ShareShare
ReportReport
Posted on by 8
Hello All, 
 
I am trying to create a Power Automate flow that uses the date in one column and produces a list of rows for those columns that fit the criteria. Essentially expiration dates to create a list of users who owe documentation.
 
I need the list to run at the end of the month for the following month. For example, the list to run June 30 and produce a list for all users whose training date is equal to or less than July 30(1). 
 
Essentially, if their training is due by the end of July 30 or overdue their row (name and other info) will need to be exported to this list. 
 
I have attached screen shots and the calendar convention is MM-DD-YYYY.
Categories:
  • Suggested answer
    SamFawzi-SmartSolutions Profile Picture
    326 Super User 2025 Season 1 on at
    Create a Spreadsheet based off of column date
     
    For the variable initialization, you'll need to correct the initial value. Based on the screenshots you provided, it looks like you pasted it as text when it should be set as an expression. Please update these two items, and you should be all set. 
    I've attached the screenshots for your reference.
  • CU21051704-0 Profile Picture
    8 on at
    Create a Spreadsheet based off of column date
     
    Please see attached screenshots so you can see the flow as I have based on your guidance. 
  • Suggested answer
    SamFawzi-SmartSolutions Profile Picture
    326 Super User 2025 Season 1 on at
    Create a Spreadsheet based off of column date
     
    you need to initialize the 2 variables before the get items action - see the screenshots in my previous notes.
     
    NextMonthDate 
    type : string
    formatDateTime(startOfMonth(addDays(utcNow(),30)), 'yyyy-MM-dd')
     
    nextMonthEnd
    type: string
    addDays(formatDateTime(startOfMonth(addDays(utcNow(),60)), 'yyyy-MM-dd'),-1)
     
     
     
    in the get items filter query 
     
    TrainingDate  ge '@{variables('NextMonthDate')}' and TrainingDate  le '@{variables('nextMonthEnd')}'
     
     
    let me know if that works
     
  • CU21051704-0 Profile Picture
    8 on at
    Create a Spreadsheet based off of column date
     
    Currently getting this error when trying to run the flow. Everything else looks mirrored to your screenshots.
     
     
     
    The expression "TrainingDate ge 'addDays(formatDateTime(endofMonth(addDays(utcNow(), 60)), 'yyyy-mm-dd'), -1)' and TrainingDate Ie 'addDays(formatDateTime(endofMonth(addDays(utcNow(), 60)), 'yyyy-mm-dd'), -1)'" is not valid. Creating query failed.
    clientRequestId: f6a96bac-9d73-4208-a1bc-5a31e4cc4785
    serviceRequestId: ba7ea5a1-209d-0000-2c3d-dd2e05a23ace
  • SamFawzi-SmartSolutions Profile Picture
    326 Super User 2025 Season 1 on at
    Create a Spreadsheet based off of column date
    here is the rest of the screenshots
  • SamFawzi-SmartSolutions Profile Picture
    326 Super User 2025 Season 1 on at
    Create a Spreadsheet based off of column date
     
    In the screenshot, I've opted to email the report instead of saving it to Excel. The report will now be included in the body of the email. I also updated the variable syntax, which you can see in the screenshot.
    If you need any further assistance with this, please let me know!
  • CU21051704-0 Profile Picture
    8 on at
    Create a Spreadsheet based off of column date
     
    Could you provide screenshots of the flow process. I have everything in place but final three steps (bold type). I just want to make sure I'm following your steps properly in the flow process.
     
    Additionally, the column we are filtering for the date comparisons is called "Most Recent Awareness Challenge Date"
  • Suggested answer
    SamFawzi-SmartSolutions Profile Picture
    326 Super User 2025 Season 1 on at
    Create a Spreadsheet based off of column date
     
     
    Can you please follow these steps after your trigger?
    Initialize Variables
     
    Add an Initialize variable action to create a variable called nextMonthDate and set its type to String. Use the following expression to calculate the last date of the next month:
    formatDateTime(startOfMonth(addDays(utcNow(),30)), 'yyyy-MM-dd')
     
    Add another Initialize variable action called nextMonthEnd to store the last date of the next month (e.g., July 30). Use this expression to calculate it:
    addDays(formatDateTime(startOfMonth(addDays(utcNow(),60)), 'yyyy-MM-dd'),-1)

    Get Rows from the Data Source
    Add a Filter query to the Get items action.
     
    TrainingDate ge nextMonthDate and TrainingDate le nextMonthEnd
     
    Add a Select action to shape the filtered data. Choose the fields you want to include in the output (e.g., name, email, training date).
     
    Create your final list based on the selected and filtered data.
     
     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >