Skip to main content
Nintex Community Menu Bar

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

@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







 



Task Email





 



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.


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? 


@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?

@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."  


@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.


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


@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.


@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. 


@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):



 





 



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





 



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




@butlerj Awesome. Many thanks for your help. 


Reply