For a mini-project I’m working on, I had a need to convert a number to it’s binary format.
From those that don’t know what that means, it’s converting a numerical value into it’s 1’s and 0’s version.
1 = 1
2 = 10
3 = 11
100 = 1100100
Feel free to read more on the Wikipedia – Binary numeral system
Yet again, this is really something that could easily be done in custom Inline Function or a custom Action. But, I think User Defined Actions are not being utilized as much as they should be, so I decided to make one that does this for me.
I won’t be going through how the UDA does what it does. It’s freely visible if you download the UDA and import it.
One thing that is worth noting, is that his UDA uses loops to run some mathematical calculations, and as such, it would be better if Safe Looping was disabled. I don’t usually recommend doing this, but it comes down to who is designing your workflows and whether they are careful enough not to build the chances of infinite loops.
If you don’t have Safe Loop disabed, then these calculations could potentially take a lot of time. So it’s something worth being aware of.
This is actually a very easy UDA to use. It takes a Number as in the input and a Text variable as the output.
What the UDA looks like.
Files to Download
You can download the files below, depending on where you prefer to import your UDAs.
Decimal to Binary UDA – NWF (Design) Download – import into the designer
Decimal to Binary UDA Download – import into Site Actions->Nintex Workflow 2010->Manage User Defined Actions