Skip to main content

How do I use JobInfos and Master JobInfos in Lasernet? - Knowledgebase / Lasernet / Lasernet FAQs - Formpipe Support Portal

How do I use JobInfos and Master JobInfos in Lasernet?

Authors list

Within Lasernet there is a framework set up for scripting, which can allow you to manipulate data more than with the standard tools. One of the major parts of the scripting is JobInfos. If you have coded before it is best to see JobInfos as variables, if you haven’t then a JobInfo can be seen as a label for a value that can be retrieved or changed. The main reason to use a JobInfo is so that you can use data from the input file in our scripts.

To do this in a form there is a JobInfo tool that allows you to set a JobInfo in the same way you would set up a Rearrange. You can then give a name to this JobInfo which can then be used in a script to retrieve the information stored in the input file.

You can also combine JobInfos with patterns to extract an array of data from an input file. For example, if you are working with an invoice and the customer has ordered five items, then you could arrange a JobInfo which would take in the cost of each item so you could work through the array and add up each item value to get an overall total.

var month = job.getJobInfo("month",0):

JobInfos are very helpful but they will only hold their value for the lifespan of the Job, this means that if you are processing several sheets to be combined later, then JobInfo values will only exist for each individual sheet and the values won’t be combined.

masterJob.setJobInfo("masterMonth","June"); var month = masterJob.getJobInfo("masterMonth",0);

A Master JobInfo works in a very similar way to a standard JobInfo but its value is more persistent, so a value can be held between sheets. An example of this could be if you have an invoice, and the final page is generated separately you may want to hold the total in a Master JobInfo so it will be accessible to the final page which is generated later.

Helpful Unhelpful

1 of 2 people found this page helpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?