How to read Number of Records?

Hello again,

how can I read the total number of records in PrintShop Mail Connect (no Datamapper)?

In the Data model pane the totalrecords are shown, so it should be possible to read that value out…
Screenshot data model pane

Regards,
Thomas

This is currently not possible in PSM Connect. It requires the DataMapper. Will create an Improvement Request for that.

Erik

Thank you for your reply. That would be nice, beacause it`s an important (standard) feature for many printshop mail customers (function in PSM: record_count() ).

After almost four years, the function to get the number of records is still missing in the Designer and/or the Datamapper.
Almost every customer in the print production business needs this function in some cases and they do not want to use the Workflow tool (in most cases they are not allowed to use it). Anyway, the PrintShop Mail Connect customers can not use the Workflow tool.

Is this feature really on the roadmap? Or will there be another workaround without using the Workflow tool?

I do not get it in my brain why the Datamapper and Designer are able to show the number of records but the customer can not use this value…

Sorry that I keep on bothering about it, but I am confronted with it again and again.

In the Output Creation Wizard, you may get the total records\documents with ${job.count.documents}.

Thanks Rod. But what if I need that info in a script within the Desiger?

Can you provide a use case or an example?

@thomasweber, just a check if you ever managed to get this to work after 3 years?

Can you let us know please in what kind of scenario you would like to be able to do so?

Hi @Marten,

My use case it to try and avoid running it through the workflow to have to get this total record count. Sometimes I just need a fast way to get them instead of having to run it through the workflow. For example, printing a document(s) via Ctr + P option via a server. This elimiates the need to have to get the total record count from the workflow. Sorry for typing a lot but hope there is an easier way to get this and not having to pass through the workflow process.

@james123456 actually there is no easy way to have access to the total amount of records within Designer script. If you have a line based text file as input in the Datamapper (e.g. csv file) you can use a preprocessor step to count the lines in the file and store that value in a record field.

Example preprocessor script (1 line = 1 record):

var reader = openTextReader(data.filename);
recordCount = 0;
while((line = reader.readLine())!= null){
  recordCount++;
}
//-1 to ignore first line with header columns
record.fields.record_count= recordCount -1;

Otherwise you only can get the total amount of records only in Workflow or within the output.

I also don’t understand why a value that is clearly displayed in the Datamodel pane (what means it is known to the program) is not made available to the user.

Of course, I understand that output settings can have further influence on certain values (e.g. by imposition, grouping, etc.), but I also think that a data set remains a data set regardless of output settings. Even if I put e.g. 3 records into one group, they remain 3 records. I think the problem here is that Connect doesn’t think in terms of records but in terms of documents!?
Most of our customers also do not understand why the “Documents” option has to be selected for an exact separation by records.

What do you need that record count for? If you need a count like that on your output, you can add content from the print preset. Use ${document.count.job} for the number of documents in the job.

A simple example would be a cover sheet that shows certain informations for production staff, including the total number of records. Maybe @james123456 give another example.

Hi @thomasweber, actually that’s the main important reason and example I would use this.
Just wanted to stress this point, is there a way we could have access to this variable in the datamapper

image

that we can utilise. I understand the implication this will make but that value is already being displayed to us in the datamapper which we could have access to? We could have it only readonly so that it takes care of the issue if someone tried to update this number. Sorry for having to complain on a Thursday morning :slight_smile:

That can be done with the functionality in the output presets.
The one thing that still takes some effort, is adding that cover page (we are fixing that!), but adding the document count (which is the same as the record count) is straightforward.

The number you see in the DM panel is accurate in PSM Connect but not necessarily in PReS or PlanetPress Connect.

When you open a DM config in PReS or PlanetPress Connect only a portion of the input data is processed, it stops as soon as it reaches the configured record limit (200 by default). It doesn’t even process the entire input data file when content creation starts; each record is processed and streamed separately. The progress indicator is based on a best guess of the record count.

PSM Connect works differently. You can only use File > Add Data, and it immediately processes the entire file. The number shown in the DM panel is guaranteed to be accurate and we should be able to expose that to content creation, so one option would be to only implement this for PSM Connect.

In the meantime Manuel’s suggestion sounds like a good solution.

Hi @Sander,

I knew you were going to say this “it stops as soon as it reaches the configured record limit (200 by default)” as it’s definately true but still the point is why not provide access to the total record count as a readonly property to the datamapper. That variable “${document.count.job}” if can be used, how can I add it to the document as a cover sheet; is only acceccible at the output creation stage, so I don’t think @Manuel is that viable for this. Also, you have to do alot of work for this to work correctly.

Would like to have this feature added or bumped up in the development chain if possible not only on the PSM but also PP suite too.

1 Like

Apologies, I got that property with the document count wrong. It should be ${job.count.documents}.

The attached preset will add that document count, and the sheet and page count to the first page of a job. It will work with PSM Connect, PlanetPress Connect and PReS Connect. document-count.OL-outputpreset (19.5 KB)

Getting that additional page in front of the job is currently less straightforward. You can: have a dummy record at the beginning of your data (in that case, use ${job.count.documents-1} in the preset), or add an additional sheet to your first document with a condition in the template (if that doesn’t interfere with, for instance, an inserter machine).
We are addressing this challenge.

Hi @Manuel,

Thanks for this work arround. I have had a look at this post (New Feature Request - Output Creation - Add Additional Content to a Slip Sheet Page - Designer - Upland OL User community) do you know if it’s still in the development pipeline? was wondering if there are any updates on being able to add content on a slip sheet? I can see that when you add a match barcode on the sheets the sequences only get added to the first record not the slip sheet.

Or is there another way to approach this?

Cheers,
James.

We intend to have a banner page feature in the next release. At the very least it will give you that empty page up front that you can put your own information on, using the existing output preset functionality. We also want the option for some standard information on the banner page, so you don’t have to put everything on there yourself (still allowing you to add more info as needed).

Disclaimer: anything intended for future releases is subject to prioritization; there’s always a chance that we may have to drop a feature due to unforeseen causes.

1 Like