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

Ticket Number generation with prefix ( Do not Use default ID Column in Sharepoint)

Hi,

I have 4 screens in canvas app. i.e Screen A, Screen B, Screen C, Screen D

Screen A - Multiple or Single entry to SharePoint at a time - Prefix - ABCD

Screen B - Single entry to SharePoint at a time- Prefix  - EFGH

Screen C - Single entry to SharePoint at a time- Prefix - MNOP

Screen D - Multiple or Single entry to SharePoint at a time- WXYZ

 

Required Ticket Number in SharePoint column as follows

 

ABCD00001
ABCD00002
ABCD00003
ABCD00004
EFGH00005
MNOP00006
WXYZ00007
ABCD00008
WXYZ00009
WXYZ00010

 

Thanks & Regards

 

 

 

 

 

4 REPLIES 4
TheRobRush
Super User
Super User

Just quick and easy solution if you really don't want to use default id column as counter. Make a second list with 3 columns

 

Column 1: String (Screen A, Screen B, Etc)

Column 2: String (ABCD, EFGH, Etc.)

Column 3: Number (Start at 0)

 

Every time you submit an item from a screen

           run a lookup on the second list for the screen name, 

           add +1 to its value column

           concatenate column 2 & column 3

           submit your concatenated string to the official SP List

 

C'est Voila

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Drrickryp
Super User
Super User

@knsrinath 

When you increment a number in SharePoint, to avoid delegation issues, use First(Sort(yourlist, yourcvalueolumn, Descending)).yourvaluecolumn+1.  Max() and Last() are not delegatable and once you have exceeded the maximum allowed number of tickets, they won't work right.   First(Sort(..  will work regardless of the number of tickets. 

@TheRobRush 

Thanks for your reply.

Is it work for multiple entries at a time.

 

Thanks!

Sure, it could. Depending on how those multiple records are being selected and sent it will be done different ways.

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,156)