cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
knsrinath
Helper IV
Helper IV

Unique Serial Number

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.

 

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
CNT
Community Champion
Community Champion

@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
	}
)

View solution in original post

CNT
Community Champion
Community Champion

CNT
Community Champion
Community Champion

@knsrinath Glad to help!

 

Please remember to give a 👍 and accept the solution as it will help others in the future.

View solution in original post

13 REPLIES 13
CNT
Community Champion
Community Champion

@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.

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
Community Champion
Community Champion

@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
Helper IV
Helper IV

 
knsrinath
Helper IV
Helper IV

 

Thanks for your Mail

I have few errors. Please find attachments...

zmorek
Power Participant
Power Participant

Use myID: instead of myID=

CNT
Community Champion
Community Champion

@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!

@CNT

Thanks for your reply

Error found

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

 

knsrinath_0-1623502848252.png

 

Thanks & Regards

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,549)