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 / How to generate a invo...
Power Apps
Unanswered

How to generate a invoice number automatically in powerapps

(0) ShareShare
ReportReport
Posted on by 62

 Here we required  to generate an invoice  number automatically, when ever a user open an App. in the invoice field(TEXT INPUT). The invoice number automatically generate. for example number starts with 0001. In the TEXT INPUT, When ever user opens an app. 0001 has to fetch to the invoice text input. and then it goes on increase for next time. it should be 0002 in the invoice INPUT TEXT.

Categories:
I have the same question (0)
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi,

     

    There a re a couple of things you can do:

     

     - generate a guid. In a label use GUID();

    -  If you datasource allows, you can have a Autonumber (Dataverse); AUTO_INCREMENT for SQL (SQL AUTO INCREMENT a Field (w3schools.com) );

    - Also, you can look at your datasource, find the last number and add 1. Here's one way of achieving it: First(SortByColumns(Accounts, "accountnumber", Descending)).'Account Number' + 1 (please adapt)

     

    Regards

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    This will work too:

     

    Index(SortByColumns(Accounts, "accountnumber", Descending), 1).'Account Number' + 1

     

    Maybe someone can elaborate on the merits of Index over First?

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard