Print all the record in output

Hi,

I’m a newbie here, hope you can help me. I want to print all of the records of an input file as detail list and filter out all the records who doesn’t have a value in the specific fields.

e.g. I have 10 records in the input file(CustomerID, Name, Email), I want to print all records who have value in Email fields as a detail list? The requirement is to print 1 output with the list of all records. I’m trying to used the detail table but I can’t select the root table.


00001 - ivan.loke@gmail.com - IVAN LOKE
00002 - allan.lim@gmail.com - ALLAN LIM
00003 - ken.yew@gmail.com - KEN YEW


First of all, what is your data type? CVS, XML, Text?

Hi,

It is a Text file

What do you mean by

I’m trying to used the detail table but I can’t select the root table.

Hi,

Here’s what I mean.

image

@kbernardino I think this may be what you are after:
This gives you the first detail record (“31/05/2013”):

record.tables["detail"][0].fields["TR_Date"]

this would give you the second record:

record.tables["detail"][1].fields["prod_id"]

So you need to loop through the record.tables["detail"] array and output each record.

var i; for (i = 0; i < record.tables["detail"].length; i++) { text += record.tables["detail"][i].fields["prod_id"]+ "<br>"; }

I hope this helps?

I think I understand now your dilemma…you are trying to print all records that have a value in the field email. And your email field in NOT in a nested table (subrecord) but in the main record…right?

And you are trying to access the main record from a HTML detail table? Am I right?

Hi Hamelj,

Yes, that’s is what I mean. I want to print a list of main record in one output.

Then you need to revise how you are currently defining a record. HTML Detail table cannot go across records.
So if for instance you defined a record to be X number of lines of your original data sample, then you should revise this so the whole file fits in 1 record.