Is there any way to use eval-data within a table-data row?
We're trying to add an option for people to score a table-data entry by selecting a variety of criteria from a few list-data macros within the table row, as follows:
Ideally each entry should then be calculated, and in isolation, they are.
However, I understand that we're introducing multiple instances of the same named fields within the page and I guess it's getting confused. Is there any way of being able to do this, or can you suggest an alternative approach? We really need to be able to dynamically add further scores, hence our original approach by using a table-data macro.
Many thanks,
Daniel
{table-data:Migration Scores}
||Steps Indicator||Manual Data Entry Indicator||Time Indicator||Upgrade Index||
| {center}{list-data:UG No of Steps}
{list-option:1}0{list-option}
{list-option:2-5}1{list-option}
{list-option:6-10}2{list-option}
{list-option:>10}3{list-option}
{list-data}{center} | {center}{list-data:UG Manual Entry}
{list-option:0}0{list-option}
{list-option:1-2}1{list-option}
{list-option:3-5}2{list-option}
{list-option:>5}3{list-option}
{list-data}{center} | {center}{list-data:UG Time}
{list-option:<10>45 min}3{list-option}
{list-data}{center} |{center}{eval-data:UG Confidence Index|format=#0}${UG No of Steps}+${UG Manual Entry}+${UG Time}{eval-data}{center} |
{table-data}
Ideally each entry should then be calculated, and in isolation, they are.
However, I understand that we're introducing multiple instances of the same named fields within the page and I guess it's getting confused. Is there any way of being able to do this, or can you suggest an alternative approach? We really need to be able to dynamically add further scores, hence our original approach by using a table-data macro.
Many thanks,
Daniel
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?What do you mean by 'in isolation they are'? I think the main issue that {eval-data} will be having is that your data values are stored as text, not numbers.
-
Inappropriate?Hi David - sorry if I wasn't being clear. By "in isolation", I mean that if I try the same markup outside of a {table-data} macro, it will work correctly. The way I'm using the {list-data} macros is to display a set of 'human readable' criteria in edit view and then this is being saved as a number (in place of the value displayed in Scaffolding view) when the page is saved.
I have tried by substituting a {number-data} macro for the {list-data} macros and this exhibits the same behaviour both in and out of the {table-data} macro.
In each case, the {eval-data} expression is displayed as '0' when the page is saved, whereas the expression outside of the {table-data} macro is being correctly calculated.
I have also tried using a {repeating-data} macro and an {eval-data} macro and the same result appears to be exhibited here also. For reference, here is the markup I've tried:
{repeating-data:Equation}
1: {number-data:A}{number-data}
2: {number-data:B}{number-data}
Total: {eval-data:C|format=#0}${A}+${B}{eval-data}
{repeating-data}
In the above case, A (e.g. 10) + B (e.g. 20) = 0, irrespective of what goes into the fields.
1: {number-data:D}{number-data}
2: {number-data:E}{number-data}
Total: {eval-data:F|format=#0}${D}+${E}{eval-data}
In the above case, D (e.g. 10) + E (e.g. 20) = 30, which is correctly evaluated.
Hopefully, this shows what is going on inside my brain, but please let me know if I've missed anything else out. -
Inappropriate?Ah, ok. Are you using Scaffolding 3.2.0? There was a bug in earlier versions where {eval-data} would not work inside a {table-data} or {repeating-data}, which was resolved in 3.2.0. I suspect that may be the problem if it is working outside one of those elements.
Scaff 3.2.0 requires Confluence 3.0+.
Loading Profile...



EMPLOYEE