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

Finding the highest value

Jump to solution

Hi

I have a number of fields where users can choose from option A to E, with A being the highest value.  I need to find out what the highest value is that has been chosen out of any of these fields.

For example:

Field 1 value chosen B

Field 2 value chosen E

Field 3 value chosen A

The highest value is A, which is in field 3.

Field 1 value chosen C

Field 2 value chosen B

Field 3 value hosen D

The highest value is B, which is in field 2

Is it possible to get these fields into an array or set of value that I can sort and then pick the highest or something.  Any help is highly appreciated .

Thanks

Labels: (1)
0 Kudos
Reply
8 Replies
cassymfreeman
Nintex Newbie

Re: Finding the highest value

Jump to solution

is this in workflow?  you can use the collection operation action to add these fields into the collection and then sort etc

Reply
gerrit_vaneijk
Nintex Newbie

Re: Finding the highest value

Jump to solution

Sorry, this is in a form.

Reply
emha
Nintex Newbie

Re: Finding the highest value

Jump to solution

within the form you could do it eg. following way.

place a calculated control on the form and set its formula following way.

f1-f4 are named controls which 'highest value' is evaluated

String.fromCharCode(min([f1.charCodeAt(0),f2.charCodeAt(0),f3.charCodeAt(0),f4.charCodeAt(0)]))

it's little tricky but hopefully you will  manage to get it working.

Reply
gerrit_vaneijk
Nintex Newbie

Re: Finding the highest value

Jump to solution

That's an awesome solution, thanks Marian.  Great to know also that it's possible to add JavaScript into a formula.  Is it possible to add multiple lines of JavaScript code?

0 Kudos
Reply
emha
Nintex Newbie

Re: Finding the highest value

Jump to solution

to be honest, I've tried that before.

but why not

0 Kudos
Reply
gerrit_vaneijk
Nintex Newbie

Re: Finding the highest value

Jump to solution

Great, thanks Marian

0 Kudos
Reply
obaidaaqel86
Nintex Newbie

Re: Finding the highest value

Jump to solution

Hi Marian,

  1. I have a 5 of fields where users can choose from option (Incidental,Minor,Moderate,Major,Sereve) , with Sereve being the highest value.  I need to find out what the highest value is that has been chosen out of any of these fields.

 

For example:

Field 1 value chosen Incidental

Field 2 value chosen Minor

Field 3 value chosen Moderate

Field 4 value chosen Major

Field 5 value chosen Sereve

The highest value is Sereve, which is in field 5.

Field 1 value chosen Incidental

Field 2 value chosen Minor

Field 3 value chosen Moderate

Field 4 value chosen Major

Field 5 value chosen Incidental

The highest value is Major, which is in field 4

Field 1 value chosen Incidental

Field 2 value chosen Minor

Field 3 value chosen Incidental

Field 4 value chosen Incidental

Field 5 value chosen Incidental

The highest value is Minor, which is in field 2

  Any help is highly appreciated ?.

0 Kudos
Reply
emha
Nintex Newbie

Re: Finding the highest value

Jump to solution

this seem to be completely different problem to the one discussed in this topic.

I'd suggest to start new question.

0 Kudos
Reply