I want to know how can I by default let Power apps auto generate the auto number field in power automate or flow.
Can you please be more specific about "generate the auto number field in power automate or flow"?
i have a auto number field in entity which is basically a primary key. In model driven app, this number is incrementing by itself. Is there a way we can have the same functionality in power automate or flow.
I don't think you'll be able to do this in a robust way (i.e. being certain to avoid duplicates) using Power Automate. Any robust autonumber mechanism needs to be able to lock a shared resource (i.e. the current / next number) to ensure numbers are generated sequentially (rather than concurrently). The design of Power Automate doesn't give you any locking control; you'll need to use something backed by a data store - e.g. CDS autonumber fields, or a SQL table with an identity column
So I have been trying to the same thing and so far I managed to get an autonumbering system in power automate without the issue of having duplicates. You will need 2 fields in order to have a completely unique numbering system, 1 field where your autonumbering code will be saved and 1 field to determine the index.
It is true that you will need limit your trigger of your flow to a degree of parallelism of 1. This way the flow will execute 1 at the time generating your codes in a unique fashion.
To generate autonumbering code based years you will need quite a few steps to go through (I added a screenshot of it aswell at the bottom of the steps):
As you can see in this screenshot: https://i.imgur.com/Lvpak14.png
When you create the record don't forget to set both the code and the index of the code. Otherwise this method won't work properly.
You can easily alter this setup for other values you want to include like option sets and stuff.
If this post helped you click the like button and if it solved your issue please accept it as the solution!
So many events that are happening this month - don't miss out!
Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.
Your chance to join an engaging competition of Power Platform enthusiasts.