How to auto-generate a specific number using information from date column on Sharepoint

annonnon 101 Reputation points
2021-10-28T21:58:21.207+00:00

Hi,

Apologies if this is more suited to be posted on Power apps community, but I would like some assistance if possible:

I have a sharepoint list with columns, among other columns, titled: Serial Number, Job type, Serial Start Date, and Serial End date.
The ‘Job types’ column includes 5 different choices to choose from.

For the serial numbers, I would like them to be auto filled as Date+Specific 3 digit code of the job type.

Eg. If I select Job Type 1, and the start date is on 29/10/2021 and end date on 29/10/2021 as per the date and time column,

          Serial Number = 29001

If I select Job Type 2 and choose the dates 28/10/2021 to 28/10/2021,

          Serial Number = 28002

Is there a formula to use in Sharepoint to do this, or a code to put into Power Apps form?

Would greatly appreciate any assistance. Thank you.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,209 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,024 questions
0 comments No comments
{count} votes

Accepted answer
  1. Emily Du-MSFT 50,021 Reputation points Microsoft Vendor
    2021-10-29T07:30:15.21+00:00

    @annonnon

    You could create a calculated column named Serial Number, then use following formula in the calculated column.

    =IF([Job type]="Type1",DAY([Serial Start Date])&"001", IF([Job type]="Type2",DAY([Serial Start Date])&"002"))

    Result:

    144880-1.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.