Skip to main content
Inspiring
Feb 9, 2019 12:42 PM UTC
Question

short 10 fields value number min to max

hello team,

i have 10 text fields

Text1

Text2

Text3

.

.

.

.

.

Text10

i want a solution how to short numbers min to max on this fields

e.g.

Text1 value = 1

Text2 value = 3

Text3 value = 2

2

7

6

5

Text8 value = 9

Text9 value = 10

Text10 value = 8

and i want system check the fields and short the number

1

2

3

4

5

6

7

8

9

10

any help?

This topic is closed to new replies. Start a new post to keep the conversation going.

16 replies

hackertomAuthor
Inspiring
Feb 12, 2019 8:53 AM UTC

i try this code to read text values :

var fieldst = ["Text1","Text2","Text3","Text4","Text5","Text6","Text7","Text8","Text9","Text10"];

for (var i in fieldst) {

    var f = this.getField(fieldst);

    if (f.valueAsString=="1||2||3||4||5||6||7||8||9||10")

{

var points = [,];

points.sort(function(a, b){return a-b});

}

}

now i want some help how to add this value fields on table when this value = number ....

Translate
hackertomAuthor
Inspiring
Feb 11, 2019 12:55 PM UTC

i collect all the values, and put them in array, array short the values like this:

var points = [40, 100, 1, 5, 25, 10, 20, 38, 25, 12];

points.sort(function(a, b){return a-b});

now how to put the minimum value on Text1, and biggest on Text10? how to avoid values which are not numbers?

Translate
try67
Community Expert
Community Expert
Feb 11, 2019 1:03 PM UTC

Iterate over the array from start to end and apply each value to the corresponding field.

Just remember the array indices start from 0, not 1, so you need to add +1 to the array index number to get the correct index number for the fields.

Translate
hackertomAuthor
Inspiring
Feb 11, 2019 12:24 PM UTC

i need a example not a full code, and i think this forum is for help not for pay to solve the problems...

Translate
try67
Community Expert
Community Expert
Feb 11, 2019 12:47 PM UTC

Example of what, exactly?

Translate
hackertomAuthor
Inspiring
Feb 11, 2019 11:33 AM UTC

it is possible for any code example because i stuck...

Any fiend must check all other fields every time? if fields isn't a number but space or latter or something else how to avoid?

Translate
try67
Community Expert
Community Expert
Feb 11, 2019 12:18 PM UTC

You have enough information to write the code yourself, I believe. If you have specific questions we'll be happy to answer them, but if you want someone else to do your work for you, you'll probably need to pay them.

Translate
Bernd Alheit
Community Expert
Community Expert
Feb 9, 2019 2:30 PM UTC

You mean "sort" ?

Translate
hackertomAuthor
Inspiring
Feb 9, 2019 2:41 PM UTC

Yes sorry for this mistake sort I mean

Translate
Bernd Alheit
Community Expert
Community Expert
Feb 9, 2019 3:21 PM UTC

Read all values, sort the values, and save the values in the fields.

Translate