Hi,
I want to be able to segregate my accounts based on their activity. If an active account has less than 5 invoices in 6 months, I want its status to change to Inactive. Check should happen every month.
Thank you!
Patrick
You can create Schedule flow to run every month.
docs.microsoft.com/.../run-scheduled-tasks
then use List rows to fetch active accounts. Loop through each account and fetch related invoices created in last 6 months using fetch xml which are associated to account
- then check count of invoices by using conditions
- If count<5 deactivate account else do nothing
Condition ->
Get Count of List rows -
https://d365demystified.com/2020/05/20/get-count-of-records-retrieved-in-cds-connector-in-a-flow-power-automate/
Please mark my answer verified if this is helpful!
Regards,
Bipin Kumar
Follow my Blog: xrmdynamicscrm.wordpress.com/
Thank again! I am still working on it and I would like ot know what is the actual full expression in the last condition: Fx Length(....)?
length ('Value') from previous output?
HI,
Please see below the expression I used to check count of records -
length(body('List_rows_2')?['value'])
List_rows_2 -> My List Row action name so if you are renaming this to something else then you will need to update the formula as well.
Please can you help here. where can I find the settings to configure the buffer please. I have more than 10,000 lines in my Account table to run everyday to check the status based on their activity.
Thanks.
Hello Patrick,
You can use the Pagination where u can override the default fetch record count. Please refer article to update the pagination.
powerusers.microsoft.com/.../1258148
Thank you,
Amit katariya
I still a weird error message. Please can you help?
Can you please share list rows filter rows property value ?
I think you are missing paranthesis or you are having extra paranthesis.
_customerid_value try this.
You can use Fetch XML builder in xrmtoolbox to generate the query.
Thanks,
Bipin
This is the error message: ')' or operator expected at position 13 in '( customerid value eq 8edd6738-d8c9-eb11-bacc-000d3a231383 and Microsoft.Dynamics.CRM.LastXMonths(PropertyName='createdon',PropertyValue=6))'.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 113 Super User 2025 Season 2
MVP-Daniyal Khaleel 104
#ManoVerse 56