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 / Random number as a Tit...
Power Apps
Answered

Random number as a Title on Customized SharePoint Forms

(0) ShareShare
ReportReport
Posted on by 71

Hello Everybody,

 

As the subject says, I am trying to find a way for a random number to be part of my title column. My wish is tho have the title been generated automatically by a Concatenate syntax. This tile would be created based on...

  1. A selected value of a dropdown box. (Type_Of_Request)
  2. A random 6 digit number. (intRandomNumber)
  3. Another dropdown value. (Project_Title)

So far I have come up with the syntax below. Putting together the above points as a unique ID.

 

Concatenate(
Switch(Type_Of_Request.Selected.Value,"New Construction","N","Maintenance","M"),
"_",
intRandomNumber,
"_",
Project_Title
)

 

After I create and submit an entry on my SharePoint List the Id gets created as planned. But when I enter and change anything on the form, the number changes to different random number. 

The idea is to have the first random number be the same all the time for my group to have some unique ID when searching for it on the list.

 

I would appreciate any help with this matter.

Thank you.

 

Categories:
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @00236123 Where did you apply the Formular?

  • 00236123 Profile Picture
    71 on at

    The formula was added to the Title data card on the input box. The idea is to have  this Concatenate title automatically from the input entries of the formula.

     

    I separately create the variable (intRandomNumber) to create the 6 digit random number. The variable seems to work. I just want the first random number form the initial submission to stay in the title.

     

    Thanks.

  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @00236123 ok. So you have to distinguish when the Title field should generated and when it should show the actual value which got saved/submitted.

    To do so you have to wrap your Formular inside an if statement which will Look like

     

    If(Form1.Mode = FormMode.New,Concatenate(

    Switch(Type_Of_Request.Selected.Value,"New Construction","N","Maintenance","M"),

    "_",

    intRandomNumber,

    "_", 

    Project_Title

    ),Parent.Default)

     

    So when creating a new item you would generate your title field otherwise, when viewing or editing an existing item, you show the actual value of that record.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard