cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DarrylJP
Helper I
Helper I

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

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

11 REPLIES 11
DeepakS
Super User
Super User

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
Super User
Super User

Hello @DarrylJP 

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

Thank you.

Ferran

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

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

 

Flow 1Flow 1Flow 2Flow 2Flow 3Flow 3Flow 4Flow 4Flow 5Flow 5Flow6Flow6

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.
 

 

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:
 
Flow 7Flow 7

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.

 

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?

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

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

What is your complete expression on String Compilation

Hi, What is your complete expression on String Compilation?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,992)