cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DarrylJP
Level: Powered On

Creating Unique Incident ID in FLOW

This is driving me insane! Any help is appreciated!

I have a SharePoint List I use for tracking Customer Service Incidents. I am trying to utilize Flow to create the following Unique IDs based on the ID field that is autogenerated.

 

Example:
yyyy-(10000000+ID), so essentially as tickets are generated sequentially I would have 2020-10000001, 2020-10000002, etc by utilizing the ID number

 

My current flow is:
Each Time New Item is Created -->

 

Get Items (Values) -->
Compose (Get Year using utcnow('yyyy')

 

Apply to Each-->
Create Variable (adding ID and the value 10000000 together to form a new integer)
Compose 2 (Convert Variable Integer into String)

 

Compose 3 (Convert Year Integer into String) -->

 

Compose 4 (Concat output Compose 3, '-' and output Compose 2)-->

Update Items (Update Unique ID Field in SharePoint list with Compose 4)

 

 

When I run flow checker it tells me I cannot reference Compose 2 and Compose 3 in Compose 4 concat operation, this is the only error I get. I don't understand why if I converted everything to Strings why I cannot Concat them?

Any help is appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Creating Unique Incident ID in FLOW

Hi @DarrylJP ,

 

I think your expression should look like :

 

add(items('Apply_to_each')['ID'],variables('Adder'))

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

View solution in original post

9 REPLIES 9
Super User
Super User

Re: Creating Unique Incident ID in FLOW

Hi @DarryIJP,
I would say try store the output in variables and use the variables is your expression.
That doesn’t means that your current approach is not right, but I need to see your flow to find the issue for that.
Thanks,
Please accept this as solution if this solve your problem.
fchopo
Level 10

Re: Creating Unique Incident ID in FLOW

Hello @DarrylJP 

Could you share your flow and the expressions used, so we can help you?

Thank you.

Ferran

 

DarrylJP
Level: Powered On

Re: Creating Unique Incident ID in FLOW

Hello, My flow is as follows. Flow Check shows no errors, but when I run it it fails. The field is a single text field with a limit of 100 characters

 

Flow1.JPGFlow 1Flow2.JPGFlow 2Flow3.JPGFlow 3Flow4.JPGFlow 4Flow5.JPGFlow 5Flow6.JPGFlow6

Super User
Super User

Re: Creating Unique Incident ID in FLOW

Hi @DarrylJP , 

 

After looking at your Power Automate could you please confirm if in your "Apply To each" action your expression looks like:

add(items('Apply_to_each')['ID'],variables('VarID'))

Also, all your action part of "Apply To each" action - EndofID, Convert to string, string compilation, and update items.

If your answer is Yes, logically, your Power Automate should work. 

If you still find an issue, send the screen capture of error action and error message.

 

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
 

 

DarrylJP
Level: Powered On

Re: Creating Unique Incident ID in FLOW

DeepakS, 

 

I have the following expression now in my Apply to Each which I re-labelled UpdateItem

 

add(items('UpdateItem')['ID'],variables('Year'),variables('Adder'))
 
I get the following Error:
 
Flow7.JPGFlow 7
Super User
Super User

Re: Creating Unique Incident ID in FLOW

Hi @DarrylJP ,

 

your UpdateItem loop input parameter seems incorrect , it should still point to  "value" (output of GetItems) as you were using before.

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

Highlighted
DarrylJP
Level: Powered On

Re: Creating Unique Incident ID in FLOW

I ran a test and opened up the Test Log, for "EndofID - Status" it says Failed (all the predecessors of this action say succeeded, everything after says Skipped), this looks like the current cause of my problem.

 

Current code/Expression is:

 

add(items('Apply_to_each')['ID'],variables('Year'),variables('Adder'))
 
Am i missing something? Don't i have to state them like above?
Super User
Super User

Re: Creating Unique Incident ID in FLOW

Hi @DarrylJP ,

 

I think your expression should look like :

 

add(items('Apply_to_each')['ID'],variables('Adder'))

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

View solution in original post

DarrylJP
Level: Powered On

Re: Creating Unique Incident ID in FLOW

Thanks DeepakS for your patience and help, that lest step did the trick! Everything runs perfectly now!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,290)