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 / Changing a Status Fiel...
Power Automate
Answered

Changing a Status Field Older than 30 Days

(0) ShareShare
ReportReport
Posted on by 79
Hello, 
 
I have a Power Apps Gallery that is connected to a SharePoint list. In this list, I have a status column for Order, Restock, Arrived, Contact, Back Order etc. 
 
I need to update the status column to "Restock", based on records that are 30 days only if in "Arrived" Status. Below is what I have but changes all records with "Arrived" status to "Restock". The list has the date as month day year but everything seen online thus far is year date month. So initially, I thought it was working but not the case.
 
 
Thoughts or ideas?
 
Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    Filters and conditions with dates in Power Automate must use the ISO8601 date format, which is yyyy-MM-dd. However, looking at your expression, the second condition is never going to return true. How would the current date ever be greater than adding 30 days to the current date. For example, today is October 16, 2024. If you add 30 days to that, it will be November 15, 2024. October 16 is not greater than November 15 :-)

    I would change your approach in the condition to use this approach for the second condition:


    The expression on the left is greaterOrEquals(outputs('Get_item')?['body/Created'],addDays(utcNow(),-90)). This is looking for items where the item was created within the past 90 days.

    This is what is returned so you can see that the expression returns dates using the ISO8601 format:

    Based on what I have shown, you should be able to figure out a condition that meets your requirements.
  • Tasturhelden24 Profile Picture
    79 on at
    Attempted the following with three records set to "Arrived": 
     
    greaterOrEquals(outputs('Get_items')?['body/value'],addDays(utcNow(),-30))
     
    Gets a "Condition" failed. 
     
     
     
    Does the Body/Value need to be the name of the SharePoint list column? 
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I believe your expression is not valid: greaterOrEquals(outputs('Get_items')?['body/value'],addDays(utcNow(),-30)). You need to insert the highlighted portion from the dynamic content picker. Although, based on the error message, this action is within an apply to each. That makes it trickier to put this into an expression.
     
    To get this value for the expression, add a Compose action to your flow and insert the field for the expression into it from the dynamic content picker. Then click on the three-dot menu and choose Peek Code (old designer) or Code view (new designer). In the new designer you'll see something like this:
     
    {
      "type": "Compose",
      "inputs": "@item()?['Modified']"
    }
     
    Use the highlighted portion above in your expression. Of course, "Modified" will be replaced by the internal name of the field you choose.
  • Tasturhelden24 Profile Picture
    79 on at
    David_MA I attempted to follow your suggestion but seem to be stumbling still. Given the screen shot below am I way off track?
     
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    You need to put the Compose action inside the Apply to each action. You will see that it returns something different from there and this is what you will use in your expression. Although now that I have a screen shot of what you are doing, I believe this is the expression you need: greaterOrEquals(item()?['DatePartsOrdered'],addDays(utcNow(),-30))
  • Tasturhelden24 Profile Picture
    79 on at
    Feel like I am almost there. It runs all the way through but does not update anything. 
     
     
     
     
     
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    Based on your last screen shot, it is most likely not working because your condition is not set up how I suggested. The right side of the date check should be true. True needs to be entered from the expression builder and not typed into the condition. See my original post below.
     
    If the expression on the left is set up correctly, that will return either true or false. On the right, you are sending it a date so true or false is never going to be equal to a date.
  • Verified answer
    Tasturhelden24 Profile Picture
    79 on at
    What ended up working for me was the utilizing the "Get past time".
     

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard