cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
v-yuazh-msft
Community Support
Community Support

Hi @Anonymous,

 

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

Anonymous
Not applicable

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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,040)