cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Request number auto generated (by year)

I am working on a Change Management Process.

 

Two of the pieces of information entered onto the current request form are the Year and the Change Request Number.  These are currently manually entered (i.e. type into the field 2018, and type into the next field 1, 2, 3, ....(whatever the next sequential number will be)) into the infopath form.

 

When reviewing the process on Friday, my manager has asked whether this could be made automated (i.e. when you click on 'Create a new item' it will automatically pre-fill the next number: 2018-001, 2018-002, 2018-003, ...).

 

Whilst searching online I can find plenty of ways that seem to do this using older versions of SharePoint (2007, 2010, 2013) and SharePoint Designer, I haven't been able to find out how to do this using SharePoint online and Microsoft Flow.

 

Does anyone know how to do this?

 

Many thanks,

 

Adam

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Request number auto generated (by year)

Hi @AdamBradbury198,

 

Could you please explain more details about the field that you would like to pre-fill?

Do you to the pre-fill field would always compose of the day of the year and the Id of the item when you create the item in the sharepoint?

 

If you want to the pre-fill field would always compose of the day of the year and the Id of the item when you create the item in the sharepoint,please refer to screenshot below to create the flow:

Capture.PNG

The expression for the pre-fill field should as below:

concat(formatDateTime(utcNow(),'yyyy'),'-',triggerBody()?['ID'])

The flow would run successfully as below:

Capture.PNG

 

 

Best regards,

Alice

Highlighted

Re: Request number auto generated (by year)

Good day Alice,

 

The pre-filled field should look like YYYY-###, i.e. 2018-001 for the first request raised, 2018-002 for the second request raised, and so forth.

 

We can't use the ID number, as this doesn't correspond with the request numbers (as the ID number won't is already above 1, due to test entries from when I was building the system and checking that it works.

 

Also, there are multiple lists in the workflow, so the ID numbers in the different lists won't match either (due to testing, some requests stopping at the first stage, etc.).

 

Is there a way to have when a new item is created on the list, for the field to look at the previous item on the list, and add one to it?

 

Replacing the ['ID'] in the expression you have given with something that will give the next number?

 

Many thanks,

 

best regards,

 

Adam

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,277)