Power Community

Power Community

Reset or Change Autonumber-seed with Power Automate

Nowadays the standard Autonumber-field in Dataverse is actually quite functional, supporting a couple of formats that can be added in any order you want (a good learn article on the formats available can be found here: Create auto-number-attributes (Developer Guide for Dynamics 365 Customer Engagement (on-premises)) |…).

In the example below, I have created a new Autonumber-field for my Opportunity table, and set the format to follow this format:    

OP-2023-0001

Devvj_0-1699392414939.png

You might sometimes want to reset the seed-counter based on a given condition, may it be every new month or year for example.

There is a few options to reset the seed, I will show you have you do it easy in Power Automate using the SetAutonumberSeed Unbound Action.

Let’s say we wish to reset the seed back to the original “0001”-seed every new year, this can be done in just 2 simple steps.

Start with setting up a Scheduled Flow and we set

  • Frequency = “Year” 
  • Interval = 1

You can set the Time zone and Start time to a value that makes sense for you

Devvj_1-1699393550534.png

Then we just add a Dataverse action, named “Perform an unbound action” and add the following information

  • Action Name = “SetAutoNumberSeed
  • EntityName =
     
  • AttributeName =
  • Value =  

Devvj_2-1699393950924.png

There, your done 🙂

When the flow runs, the counter will reset together with the year.

“OP-2023-0347” > “OP-2024-0001”

It really is the simplest thing and makes managing the autonumber-counters a little easier, atleast in some cases.

Thank you and see you next time!
/Viktor

This post was originally published on this site

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

Power Apps Licensing for Guest Users

Inviting Guests to Access your Power App which has Premium ConnectorsA pre-requisite of access to a Power App is...

More Articles Like This

- Advertisement -spot_img