To Display or Not to Display

I have data that has been formatted correctly in the datamapper. I need to display the formatted data when its value is NOT “000000000” (all zeros - 9). Otherwise it should be displayed in the formatted version. Can anyone assist with this?

Well, you could either do this by making the element itself conditional (right click the element in the design view and click Make Conditional). This gives you a nice GUI to select which field to compare against, what value to compare against, and what to do if it matches (for instance, hide if field1 is equal to 000000000)

Alternatively, you can simply modify the text script to something like this:

var field, result = "";

field = record.fields["myField"];
if (field !== "" && field !=="000000000") result += field;

results.html(result);
1 Like