- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 08:25 AM
Hi All,
I am using the Create Record action in Flow Designer to insert records into a table. To set a unique ID for each record, I call a Script Include. This Script Include queries the same table to find the last used unique ID, then generates a new unique ID by incrementing that value by one. However, when multiple flows run simultaneously, this approach results in duplicate unique IDs being created.
How to prevent it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 08:14 PM
you can't make flow run sequentially when multiple records are inserted.
the only way to achieve is make that field unique and use before insert business rule to set the value.
Don't set value via flow on that field.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 08:31 AM
@Ankur Bawiskar @Dr Atul G- LNG Can you look into this issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 08:38 AM
Why do you need to create Script Include to achieve this ?
You can use auto-numbering records in a table,
Can you explain more if the requirement is different ?
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 08:41 AM
@Bhuvan
Becasue i have different prefixes and different number sequences for different types.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2025 08:59 AM
If you can share screenshot of your flow it would be easier to understand what you are trying to achieve.
There are multiple ways of addressing this record uniqueness check in the flow. You can lookup for a existing record and only if the condition evaluates to false, you can create new record. Check for coalesce field 'determines uniqueness' option if you have unique attribute as part of create/update record action.
Look for more details on the property, com.glide.hub.flow_engine.indirect_recursion_limit for Flow Designer system properties,
Thanks,
Bhuvan