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 Apps
Answered

Unique Ticket ID

(0) ShareShare
ReportReport
Posted on by 143

 Hi,

I have 9 different types of request(Data Quality Issue, New Data Field, Data Field Update, New BI Dashboard, BI Dashboard Update, New Data Mart, Data Mart Update, New Data Extraction Report Template, Data Extraction Report Template Update), which is a dropdown selection in power apps. I want to generate a unique ticket ID for each of type of request, for example

Lets say users have requested these tickets,

first ticket is Data Quality Issue and second ticket is BI Dashboard, the ID for each of them will be DQ yyyymmdd | 1 and BI yyyymmdd | 1

Im imagining it to be like this, the sharepoint list act as the database and power apps as the platform, so when user go to power apps and choose what type of request of ticket they want to raise, they will be navigated to the below screen, and the ID will automatically generated. When the user click submit, all of the record including the ticket ID will be updated or created in the SP list. The Type of Request column in sharepoint list is in choice type format.

Is there any way to do generate the IDs in Power Apps? Please guide me, i have been thinking about this for days.

Screenshot (744).png

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,616 Super User 2025 Season 2 on at

    Hi @mel_ 

     

    Based on the selection of the DropDown you can set a variable in the OnChange property:

    // Generate the unique ID based on the type of request
    Switch(
     Dropdown1.Selected.Value, 
     "Data Quality Issue", 
     "DQ" & Text(Now(), "yyyymmdd") & "|1", 
     "BI Dashboard", 
     "BI" & Text(Now(), "yyyymmdd") & "|1"
     //... and the others
    )

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • mel_ Profile Picture
    143 on at

    Thanks for the reply. I wanna ask, if new ticket is raised, how to set in the formula for increment of number of tickets based on each type of request?

  • scalca Profile Picture
    on at

    should it be a running number the last one next to "|" across all requests or just for that day ? 

    you can achieve this using a switch statement
    for example you will store the value of the selected type of request into a variable
    Set(varTypeOfRequest, Dropdown.Selected.Value)

    then your label control would check for it
    Switch(varTypeOfRequest,"Data Quality Issue",$"DQ{Text(Now(),"yyyymmdd")}|{Sum(First(SortByColumns(Filter(YourDataSource,RequestTye.Value = varTypeOfRequest),"Created",SortOrder.Descending)).ID,1)}","BI Dashboard",$"BI{Text(Now(),"yyyymmdd")}|{Sum(First(SortByColumns(Filter(YourDatasource,RequestType.Value = varTypeOfRequest),"Created",SortOrder.Descending)).ID,1)}")

     

    and so on

    I'm using here the ID column of the SharePoint Item and increment by one

     

     

  • Verified answer
    SpongYe Profile Picture
    5,616 Super User 2025 Season 2 on at

    Hi @mel_ 

     

    You can get the last ID and sum +1:

    First(
     Sort(
     Filter(DataSource, RequestType="Data Quality Issue"),
     ID,
     SortOrder.Descending
     )
    ).ID + 1

     

    You code would look like:

    Switch(
     Dropdown1.Selected.Value, 
     "Data Quality Issue", 
     "DQ" & Text(Now(), "yyyymmdd") & "|" & (First(Sort(Filter(DataSource, RequestType="Data Quality Issue"),ID,SortOrder.Descending)).ID + 1)
     )), 
     "BI Dashboard", 
     "BI" & Text(Now(), "yyyymmdd") & "|" & (First(Sort(Filter(DataSource, RequestType="BI Dashboard"),ID,SortOrder.Descending)).ID + 1)
     //... and the others
    )

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard