Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SxAOCqrjA93PCveX8fsIFV
Power Apps - Microsoft Dataverse
Answered

Best way to store ID in dataverse

Like (0) ShareShare
ReportReport
Posted on 15 Sep 2023 06:21:17 by 7

Hello. 

What is the best way to store ID in dataverse?

For example, usually I am using INT in SQL, or autonumber ID usual field in Sharepoint.

But in dataverse we have Autonumber and why it is text field? How I can change it to number?

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on 15 Sep 2023 at 06:43:25
    Re: Best way to store ID in dataverse

    Hi @PowerUser666,

    It is by desin, autonumber columns are formally just text columns.

     

    If you want to use an Whole Number field for AutoNumber you can Create a new Field with Text (AutoNumber) and Copy the Number to Whole Number field and Use it.

    Try the following formula to copy automate column value to whole number column:

    ForAll(AddColumns(Sequence(Value(First(SortByColumns(Table,"crba2_auto",Descending)).Auto)),"CC",Text(Value)) As A,Patch(Table,LookUp(Table,Auto=A.CC),{Number:A.Value}))

    crba2_auto is a autonumber column. 

  • a33ik Profile Picture
    3,304 Most Valuable Professional on 15 Sep 2023 at 06:34:19
    Re: Best way to store ID in dataverse

    Hello,

    Autonumber is of the type of string because it's possible to add letters to it as a prefix and postfix and/or trailing zeros that won't be possible to add as a number so the string is the only type.

    If you want to have it as a number you can add some kind of automation (plugin or power automate flow) that will take the generated number and copy it to the whole number field.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Loading started