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 / How to retire a produc...
Power Automate
Answered

How to retire a product using Power Automate Cloud?

(0) ShareShare
ReportReport
Posted on by 46
Hi
 
We have Dynamics 365 and we want to retire products meeting a certain criteria using a flow.
But when I try to "Update a row" changing the statuscode to Retired I get an error:
2 is not a valid status code for state code ProductState.Active on product with Id de2566b6-c407-e811-810f-5065f38be551.
If instead of statuscode I use statecode, the action executes without error, but the actual value is not changed (this is the output of the update action):
"statecode@OData.Community.Display.V1.FormattedValue": "Activo",
"statecode": 0,
If I change statecode and then statuscode in different actions, I get the same error (probably because statecode is not changing).

I can retire a product using CRM (one by one), and when I set a product as Retired, I see:
"statuscode@OData.Community.Display.V1.FormattedValue": "Retirado",
"statuscode": 2,
"statecode@OData.Community.Display.V1.FormattedValue": "Retirado",
"statecode": 1,
And if I change both statuscode and statecode in the same action, PA says "successfully", but the actual values are not changed at all, so the product is still active after the update.
 
So, is there a way to retire a product from Power Automate?

EDT: it turned out that PA was working but something in the background was re-activating the product.
Categories:
I have the same question (0)
  • Verified answer
    fsuarezoedt Profile Picture
    46 on at
    I tried retiring a product using the old Workflows and it works.
     
    As a work around, I created a new true/false field in the table and did a Power Automate flow with the retiring logic and trigger, to change that field.
    The Worflow monitors that field and when it detects a change, it retires the produuct.
     
    I prefer to work only with PA, but since it's not working, I resorted to this trick.
     
    Can anyone help me troubleshoot why PA can't retire the product directly?
     
    Thanks!


    EDT: it turned out that this worked because it was deactivating some products that wasn't auto-reactivating So PA works as expected, and so does Workflows. But I have to figure out what is re-activating the products

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 523

#2
Valantis Profile Picture

Valantis 318

#3
David_MA Profile Picture

David_MA 235 Super User 2026 Season 1

Last 30 days Overall leaderboard