web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Use autonumber value b...
Power Apps
Answered

Use autonumber value before Save

(0) ShareShare
ReportReport
Posted on by 48

Dear all,

 

Is it possible to use Dataverse Autonumber column value before the save event? I want to consume it from Client API - JavaScript before user hits the Save. The following line is returning empty: 

 

let caseNumberCounter = formContext.getAttribute("mm_casenumbercounter").getValue();

 

Just to let you know that I'm aware how to achieve it after saving the record, by creating addOnPostSave function.

 

Regards,

Milos

I have the same question (0)
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @Milosh 

    If the Form Mode is create than you will not be able to retrieve it only if form mode is update.

     

  • Verified answer
    Federico Pelliccia Profile Picture
    143 on at

    It is not possibile, because that field is valued only when the save's pipeline start

  • MarioRing Profile Picture
    541 Super User 2024 Season 1 on at

    Try another approach - every time you create a new record, please save the last counter value somewhere globally in the application. Then you can always query this value using JS and increase it by one to get the estimated next counter value. I hope it helps you!

  • Federico Pelliccia Profile Picture
    143 on at

    This would work only with a simple autonumber. Also, if you need to take a field, you could directly retrieve the last create record of the table and read the autonumber field, without create new field where store it.
    And still, you would risk a possible concurrency with other record created in sametime 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard