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 / Creating a Serial Numb...
Power Apps
Unanswered

Creating a Serial Number based of +1 from the last record

(0) ShareShare
ReportReport
Posted on by 7

Hi,

 

Creating a form from an existing Excel Spread Sheet. I want to give each report a specific serial number.  +1 to which ever the last report was.  

 

Under Default on the DataCardValue I have put:

 

If(EditForm1.Mode-FormMode.New, Last(Table1). Serial+1. Serial)

 

But it just comes up with a red cross.  Am I entering it into the wrong field or just have the wrong formula.

 

🙂

 

Mike

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Mike17 

    Coalesce(Parent.Default, First(Sort(Table1, Serial, Descending)).Serial+1) as the Default property of the control in the card. 

    Coalesce submits the first nonblank value and in the case of a New Form, the Parent.Default will be blank.  Last() and Max() are not delegatable so they will become incorrect once your list exceeds 500 (default) or 2000 (maximum) items.  If there is already a serial number, then Parent.Default will be nonblank and will be the value in the control.  Hide or disable the card so users cannot change the result.

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    If(EditForm1.Mode = FormMode.New, First(Sort(Table1, Serial, Descending)).Serial + 1)

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    Buy me a coffee!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Mike17 Profile Picture
    7 on at

    @Drrickryp 

    Thanks for getting back so quickly.  I just did that (PSB) but the red cross is still there.  Have I put it in the correct field?  Should it be DataCardValue1 or Threat Serial_DataCard1?

    Mike17_1-1649168598426.png

     

    Mike17_0-1649168533967.png

     

    Mike

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Mike17 

    You can put it in the default of the control or as the Update property of the card.  The data type in SharePoint should be a number. 

  • Mike17 Profile Picture
    7 on at

    @Nogueira1306 

    Thank you.  I tried that and got this:

    Mike17_0-1649168847349.png

     

    Any thoughts?  Mike

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    If(EditForm1.Mode = FormMode.New, First(Sort(Table1, 'Threat Serial', Descending)).'Threat Serial' + 1)

     

    Please check the names of the fields..

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