cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Generate unique instance ID

Jump to solution

Hey Nintex Community,

 

I've gotten a few requests to implement a unique per-instance ID so that individual approvals don't get confused. I found this solution for Sharepoint and tried to implement it in NWC, but the "InstanceID" variable I stored just output "fn-FormatDate({Common:CurrentDate},yyyy)-{ItemProperty:ID}" as a string rather than 2020-001 or however it's supposed to work. 

 

Screenshot of end result attached. 

 

How do I adapt this for the Cloud? Thanks Smiley Happy

Labels: (1)
Tags (1)
0 Kudos
Reply
10 Replies
Highlighted
Community Manager Community Manager
Community Manager

Re: Generate unique instance ID

Jump to solution

@jstraus as you discovered that particular runtime function combination won't work the same way in NWC as it did in SharePoint. However I think you should be able to use context variables to come up with a like typed solution. Take a look at my screenshots below and let me know if that's what you're looking for:

 

Task configuration

Screen Shot 2020-03-20 at 7.34.54 AM.png

Screen Shot 2020-03-20 at 7.35.38 AM.png

 

Task Email

Screen Shot 2020-03-20 at 7.36.12 AM.png

 

If you're working with SharePoint Online, you will most likely also have an Item ID variable that you could use within your task to relate to the item.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Generate unique instance ID

Jump to solution

Thanks for the quick response @butlerj! That "instance ID" is a bit unwieldy. Is there any way to create a numerical ID that just increments up from 1, or something similar to that? 

0 Kudos
Reply
Highlighted
Community Manager Community Manager
Community Manager

Re: Generate unique instance ID

Jump to solution
@jstraus two questions:

1. Are these instances related to an item in SPO, or is this information entirely within NWC?
2. Are you trying to delineate between different instances of like typed tasks from different instances of the workflow, or are you trying to delineate between different tasks within the *same* instance of the workflow?
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Generate unique instance ID

Jump to solution

@butlerj 
1. Entirely within NWC. I have a workflow set up to forward spend requests up the chain of command, the only external source the workflow links to is our active directory.
2. The former. Our Accounts Payable department is getting many requests in a given week, and would like a more specific way to differentiate between them than Project Name + Amount + Request Type. 

 

Now that I think of it, the date isn't strictly necessary. I just need to create some unique identifier that increments with each instance, so that when AP gets a request email it sasy "$1000 Task order for Anderson Project, ID: 123" followed by "$1100 Task Order for Anderson Project, ID: 124."  

0 Kudos
Reply
Highlighted
Community Manager Community Manager
Community Manager

Re: Generate unique instance ID

Jump to solution

@jstraus would something like "$1100 Task Order for Anderson Project, ID: 21103163." work?

 

I think we could easily trim the Instance ID using a Regex action at the start of the workflow that just pulls the first octet of numbers using this pattern: ^[^-]+

 

Let me know your thoughts.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Generate unique instance ID

Jump to solution

@butlerj That sounds like it would work! That'll be unique for every instance? 

0 Kudos
Reply
Highlighted
Community Manager Community Manager
Community Manager

Re: Generate unique instance ID

Jump to solution

@jstraus with how instance IDs work, it is technically the entire GUID that is unique each time, but even with the first octet of numbers you would have ~40,320 instances before you saw a repeat.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Generate unique instance ID

Jump to solution

@butlerj Understood. In that case it's probably best if I append the date as well, since this is intended as a long-term solution and the company might well go through several thousand instances a year. What's the proper command for adding the date, so it would read something like "ID: 20-03-23-21103163"? That way we could be 100% sure no repeats occur. 

0 Kudos
Reply
Highlighted
Community Manager Community Manager
Community Manager

Re: Generate unique instance ID

Jump to solution

@jstraus I would do a regex action first to get the instance ID octet and store that in a new variable (in my example the variable ID):

 

Screen Shot 2020-03-23 at 10.09.14 AM.png

 

Then in your email you can combine that with the Context variable for the Current Date:

Screen Shot 2020-03-23 at 10.10.09 AM.png

 

This should give you the unique ID that you're looking for:

Screen Shot 2020-03-23 at 10.13.09 AM.png

View solution in original post

0 Kudos
Reply