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 Apps / Ability to set column ...
Power Apps
Unanswered

Ability to set column field value as "0001" and use for calculation

(0) ShareShare
ReportReport
Posted on by 135

Hi,

 

I am trying to create a field with value "0001" where datatype as whole number to use in dynamics process flow for autonumbering. However, it consider the value as "1"

 

Is there any way to use other datatype to get this value considered as "0001" in Dataverse ? Also, if we are putting the value in text field, how can we convert it into integer value in real time process workflow (in Dynamics CRM) for calculation?

 

Any help would be really appreciated!!

I have the same question (0)
  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    If you need to prefix or pad with leading zeros then you need to put it in a Text field.  If you are using the out of the box auto number, you would need to write a Plugin or Custom Workflow Activity (possibly a Flow if not needed as real time) to convert the Text to a number and put it in a whole number field.    If it is your own auto number then write the number in a number filed and also in a text field with the format you need.

  • PurpleDeveloper Profile Picture
    135 on at

    Thank you for your response. Much appreciated!

     

    Could you please elaborate by what you meant by "own auto number then write the number in a number filed and also in a text field with the format you need"?

     

    Is that achievable with real time workflow?

  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    People have written their own auto number generators, some better than others - usually you don't see good ones that are just workflow based (unless they call an another webservice) and usually issues under heavy load (or even often low).  There can be a wide range of issues with them due to multi-threading and the distributed nature of database clusters and multiple application servers etc.  

     

    As you didn't indicate how you were getting the autonumber it was just a suggestion if you were generating it yourself (or possibly using a third-party one)

     

  • PurpleDeveloper Profile Picture
    135 on at

    That make sense. Thanks for the clarification. I am trying to achieve with flow in Power Automate or in Power apps itself to get desired output.

  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    The issue with Flow is that your DataVerse/Common Data Service triggers are asynchronous (background) so they run outside of the create transaction and with a delay so will not generate an auto number without duplicates etc.  The benefit of the out of the box auto number field is calling something that will give a unique.  

     

    If you are not so concerned about timing - use the autonumber field to give you just a sequential number (tell it you want a custom format and you can get just the seq number), then take that number(text) and do what you want and then pad it with zeros either in the same field or in another field (the autonumber does not look back at the record it has already populated so updating the same field does not throw the next record out etc)

    If you are concerned about timing you would need to do some .Net customisation and write a plugin or custom workflow activity (or find an existing library)

     

     

  • PurpleDeveloper Profile Picture
    135 on at

    Thanks Fubar!

     

    We are concerned about the timing that's why thought of doing with the real time workflow as it gives fast results. However, the autonumbering field in Dataverse was not giving us expected result as we needed customization with the column values, like to group the records of same category and autonumbering the IDs of each group. And with that for starting the value from "0001" we had to create a text field in Dataverse and convert into integer else we separated four digits into different parts and generating the number with different conditions which became very complicated and was not feasible to do so.

     

    Do you have anything we can go through for the customization or custom workflow which can help us achieve this?

  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    The out of the box auto number will just give you a sequential number, not by groups.  If you just need a sequential and prefixed with group, then you can achieve that (GRP1-0001, GRP2-0002 but not if you want GRP1-0001, GRP2-0001) - just auto number without the Group and then add the group with realtime workflow

     

    You will find Custom Workflow Activity libraries that have conversion and math functions, I don't have one I use off the top of my head - this one has some string functions that allows you to pad a number .https://github.com/demianrasko/Dynamics-365-Workflow-Tools (and always safest to use one that gives you the source code and you can recompile it).

  • PurpleDeveloper Profile Picture
    135 on at

    Thanks, Fubar. 

     

    Really appreciate all your help and suggestions provided.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard