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 / Generate unique I'd wi...
Power Apps
Unanswered

Generate unique I'd without flow

(0) ShareShare
ReportReport
Posted on by 1,119

Hi there 

 

I would like to generate custom auto generated number in share point list for a help desk system.

I do not want to use flow as i would like to show the ticket ID to end users when they submit ticket.

 

Example like HDT-0001

 

Is there way to generate the number when the item is created in share point list.

 

I don't want to show the ID column as we need to customise rhe ticket number.

 

Even if i can concat the ID column with custom prefix also would be fine.

 

But i am not sure how to do. Pls help.

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

    Okay... You have two options...

    First one, should be using a Split to Split "HDT" and "0001", after that, add 1 to that value and join again with "HDT"

     

    OR

     

    You can use a function called GUID that will generate an random ID:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-guid

     

    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!

  • venka91 Profile Picture
    1,119 on at

    @Nogueira1306 

     

    Okay. But will this be shown as ticket number  in my screen and also be updated into my share point list.

     

    What happens when more than one user submits form at same time ?

     

     

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

    Guid function would not fail there..

     

    But you can use this function:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-errors

     

    If you set that field ID as unique, if the user submit at the same time it will give an error. With that you can say to user to update the name/refresh the datasource

     

    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!

  • Houji Profile Picture
    99 on at

    do you have solution for this one?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @venka91

    The easiest is to create a number column, say nmbr. Manually enter the seed number, like 1000. In PowerApps, augment it as: First(Sort(Splist, nmbr, Descending)). nmbr+1

    You can set this as the Update property of the nmbr card and hide it.

    In the OnSuccess property of the card.: Notify("Your ticket number is " & Self.LastSubmit.nmbr, Success)

    Threr shouldn't be a problem with duplicates as the nmbr value is created in the instant the form is submitted. 

  • Irfan Profile Picture
    164 on at

    Hi,

     

    Are you after a unique ID in a specific format (in a sequence) OR can it be in any format?

     

    I have used the below in some of my apps. It gives you a 13-digit random number based on the current date and time.

     

    UpdateContext({varKeyID: Round(Rand()*Value(Text(Now(), "[$-en-US]yyyymmddhhmmss")),0)});

     

    This expression generates a random number using the Rand() function multiplies it by the current date and time represented as a string in the format "yyyymmddhhmmss" obtained using the Text() function and the Now() function, converts the resulting string to a number using the Value() function, and finally rounds the result to the nearest integer using the Round() function.

     

    Give it a shot...you'll always get a unique ID with the above formula.

    Irfan_0-1676870894211.png

     

     

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

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard