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 / Unique Serial Number
Power Apps
Answered

Unique Serial Number

(0) ShareShare
ReportReport
Posted on by 527

Hi

I have 4 Screens in PowerApps Canvas.

Each screen is using for different Data Entry and all 4 Screens data is Patching to one SharePoint List.

Screen 1 – Single Row entry in SharePoint – Screen Name - "ABCD"

Screen 2 – Gallery Multiple row entry in SharePoint - Screen Name - "EFGH"

Screen 3 – Single Row entry in SharePoint Screen Name - "KLMN"

Screen 4 – Gallery Multiple row entry in SharePoint Screen Name - "QRST"

After entering the data in PowerApps I want Generate unique ID in SharePoint List  as follows

 

ABCD00001

ABCD00002

EFGH00003

EFGH00004

KLMN00005

QRST00006

ABCD00007

EFGH00008

 

I have tried with default ID Column and Flow. It is working. By default I can not reset ID to 1.

Request you suggest any alternate method.

Your quick response will be highly appreciated.

 

 

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

    @knsrinath Meddling with the default ID column in not ideal. It is good to have your own column for this custom ID so that you can have full control over the Start number, the Prefix etc., This will keep thing simple and fully under your control.

  • knsrinath Profile Picture
    527 on at

    Can you please help me to create Serial number in one column 1,2,3,4,5....... once data created in SharePoint from power apps.

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @knsrinath 

    • First you have to create a column say, myID of type Number.
    • Then use this formula to create a new record with the myID and other fields as per your requirement.
    Patch(mySPList, Defaults(mySPList), 
    	{myID=LastN(SortByColumns(mySPList, "myID", Ascending)).myID + 1
    	 // add all the other fields you want to patch
    	}
    )

     

    Hope this helps!

  • knsrinath Profile Picture
    527 on at
    Capture123.JPG
  • knsrinath Profile Picture
    527 on at
    Capture21.JPG
  • knsrinath Profile Picture
    527 on at

    Thanks for your Mail

    I have few errors. Please find attachments...

  • zmorek Profile Picture
    3,272 on at

    Use myID: instead of myID=

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @knsrinath Replace = with : in the formula

    Patch(mySPList, Defaults(mySPList), 
    	{myID:LastN(SortByColumns(mySPList, "myID", Ascending)).myID + 1
    	 // add all the other fields you want to patch
    	}
    )

     

    Please @mention me to gab my attention. Hope this fixes your issue!

  • knsrinath Profile Picture
    527 on at

    @CNT

    Thanks for your reply

    Error found

    Invalid argument type. Expecting one of the following: Number, Text, Boolean.

     

    knsrinath_0-1623502848252.png

     

    Thanks & Regards

     

     

  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @knsrinath Sorry, It's not LastN but Last

    Patch(mySPList, Defaults(mySPList), 
    	{myID:Last(SortByColumns(mySPList, "myID", Ascending)).myID + 1
    	 // add all the other fields you want to patch
    	}
    )

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard