cancel
Showing results for 
Search instead for 
Did you mean: 

What's in a name?

Automation Master
Automation Master
13 13 2,170

A person’s name is the sweetest sound to them in any language.  Even in a crowded noisy room, you’ll probably hear your name called out over all the din.

Can you relate to when you share a name with someone?  Someone calls out your name “Hey Chris” and you and a different Chris look over at that person and wave?  A little bit embarrassing if it’s not you and a little bit inefficient.  The world would be more efficient if we had unique names but conversations would be difficult:

“Hi fingerprint ID 0010010101”
“Oh how’s it going fingerprint ID 1001010110?”
“Good man.  Good.  Happy New Year to you and your wife fingerprint ID 010111010111”

It’s much better when we can use terms such as Cassy, Andrew and Fernando* right?


The development world is a bit like this.  Beneath the scenes, everything is referred to using a unique code but we as humans can’t handle this so we’ve made life easier for ourselves by giving items names that make sense to us.

Where am I going with this post?  How should we name these things?  What makes sense?

In the Nintex world, we have Nintex variables, JavaScript variables, form controls, list and site columns and workflow constants.  You can name these however you want.  You can even give each one the same name but you’ll be asking for trouble!

Some may recall this mission where we had to fix a workflow.  One of the issues with the workflow was a list column had the same name as a variable and there is no way to differentiate between the two when you’re looking at your workflow or form.  If you do the same, you’ll make your workflows and forms harder to maintain and probably introduce a few more bugs than usual.

I’d suggest there is no single correct answer to how you should name things other than identifying/naming each of the aforementioned elements differently using a convention that works for you.  Here’s how I do it:

ElementDescriptionExample
List and site columnsPlain English with spaces.  I don’t have a convention about proper case or mixed case.  Whatever seems appropriate.Person Name
VariablesPrefixed with the notation var and I don’t use spaces.varPersonName
Workflow constantsIn all caps with words separated by an underscore.  I don’t differentiate between constant types (site collection, site, data types etc) or should I?PERSON_NAME
Form controlsAccept the Nintex default which is to take the column name and remove spaces.Personname


I’m very interested to hear what naming conventions work for you.  Do you use lowerCamelCase?  Do you use Hungarian notation/include the data type in the name?  Do you override the Nintex Forms default?  Do you use spaces in your column names?  Do you differentiate your constant types?  Let us know in the comments below.

Cheers,
Chris


* Names bear no resemblance to popular members of this community.  Whatsoever.  Honest!

13 Comments
Automation Master
Automation Master

Cassy Freeman‌, Paul Crawford‌ and others along with myself did this at my old company. 

We established our naming conventions for the Workflow Variables in the format like so:

v"datatype""description"

we also added

col"description" for our collections.

and camelCase of course

So we would have vtxtDocumentName, vpplPersonName or colListItemIds.

Brilliantly written article by the way.

murphybp2
Nintex Newbie

Good post and thanks for the examples.  For site/list columns I was taught early on to name them without spaces, otherwise the actual system name inserts "%5Fx0020%5F" for the space, which is difficult to read and I remember it causing problems at times in the past in certain situations.  After the column is created I then change the display name to have a space in it.  I don't have Nintex Forms, so don't know if it looks at the actual column name, or the display name.  I know you see the display name in the workflow designer. 

For my variable naming conventions, I use an abbreviation for the type, followed by an underscore, then the variable name.  Ex: st_Name, mt_Description, c_Tasks, etc.  "st" for single line of text, "mt" for multiple lines of text, "c" for collection.  

Automation Master
Automation Master

Thanks Ryan Smiley Happy

Automation Master
Automation Master

Interesting point about the column names Brendan.  I checked in the forms designer and, at least to the user, it uses the column display name when referring to column names.

If anyone wants some further reading about the display name vs the static name, this blog post provides a good explanation.

Cheers,

Chris

Warwick
Nintex Newbie

I've also found Ryan Greenaway‌'s method to work best, especially for debugging if you're trying to save text to a number column for example with datatype in the name.

If only we had constants in O365

Automation Master
Automation Master

One thing to note about variables and Nintex Workflow Cloud. By habit I use my naming convention for variables in a NWC workflow in which I also needed Nintex Mobile App start. So my variables were my start form. Since you (yet) cannot have a different display name, you will need to write out the name of the variable instead of using the naming convention.

Automation Master
Automation Master

We do the same Ryan. Using types in the name also help in locating where a variable is used when you go back to edit weeks later. If done correctly, you know to expect certain types within certain actions. 

Automation Master
Automation Master

Just to add to this blog as an article of helpful links about variables, see

burkslm
Nintex Newbie

Be careful of the spaces with names. They aren't spaces in the url when they are referenced. It makes it harder when trying to refer to it later. I prefer not using spaces. For example, strFirstName, intAge, etc. Of course this was how I was taught when I started programming.

Automation Master
Automation Master

Bugger!  I imagine that will change as the forms designer for NWC is expanded.  Hopefully! Smiley Happy

Automation Master
Automation Master

This is a similar issue for O365 start forms, where the variable is displayed and (as far as I can tell so far), not changeable. 

So long, txtProjectName and numProjectCode ... hello Project Name & Project Code.  

eiben
Nintex Newbie

Hi,

I work the same way: first create some "internal" column-name and the rename to column; or create the columns with powershell (CSOM), where you can specify the internal and the display-name at once.

This is also true for lists: I would always at first create the list with some "nice" internal name, as this will become part of the URL. Maybe stick with some kind of short-name, to keep the URL less then 260 characters. Then change the display-name of the list to something meaningful for endusers.

This is not as important if you're just working with Nintex (Workflow or Forms), but it becomes a real pain if you're happen to access those kind of column-names (containing space or other special characters like german Umlaute!) in code (e.g. REST, CSOM, SSOM ...). Or if you feel the need to create a custom CAML-query this will hit you as well. 

eiben
Nintex Newbie

I omit the "v" for variable usually, but other than that I usually stick to the hungarian notation as well.

Depending on the action/field/... Nintex does show references sometimes as "{WorkflowVariable:intNumber}", which makes it obvious that it's a variable