Perhaps it will be useful to someone. I tried to find a ready-made solution but couldn't.
I needed to make a table conversion of two values - first ranged 0...999 and second 0.00...9.99 and I decided to use JavaScript preprocessing for this. But here's the bad luck - only one value can be passed to the script - the value of the current item. I solved the problem as follows:
1. Created a new item with the calculated type.
2. I added to the formula
As result we will have value=73300748 for example
3. Already in the javascript itself, I decomposed the value obtained above into two that I need:
Et voila - both items are available in javascript code.
I needed to make a table conversion of two values - first ranged 0...999 and second 0.00...9.99 and I decided to use JavaScript preprocessing for this. But here's the bad luck - only one value can be passed to the script - the value of the current item. I solved the problem as follows:
1. Created a new item with the calculated type.
2. I added to the formula
Code:
(last("host:item1") * 100000) + last("host:item2")*100
3. Already in the javascript itself, I decomposed the value obtained above into two that I need:
Code:
value = value.toString(); value_pr1 = parseInt(value.slice(0, 3)); value_pr2 = parseInt(value.slice(4, 10));