You are viewing limited content. For full access, please sign in.

Question

Question

Reference variables from specific Collection row in custom HTML (without JS)

asked on February 19, 2018 Show version history

Hello, 

We would like to be able to reference variables from a collection row in a custom HTML field -- which in this case is within the collection itself -- without using Javascript. In a field that allows for functions, this is simple using the INDEX() formula and ROW() to reference the current row, but without the formula, or similarly with the jquery $(this) the values from all collection rows appear comma separated. 

Previously in this same business process, users input into a custom HTML table within the collection, which is then parsed and saved to a multiline field using JS. As JS does not load in time to be saved/printed, we can't simply re-populate the custom table in reverse, so it would be great to be able to use using the variables available to the custom HTML field.

If this is not possible, we have a workaround using a second multiline field and some formatting via functions, however as this is tabular data, it's really only possible to approximate columns and other table formatting. Is there any other way to go about this?

Thanks for reading, any suggestions are appreciated!

Jesse

0 0

Replies

replied on February 21, 2018 Show version history

Hi Jesse,

Currently it's not possible to show the field variable value in custom HTML field for the same row inside a collection without custom script: you can use variable to get a certain row in format {/dataset/Collection/Single_Line[1]} but the "same row" function is not implemented.

For the issue you said "JS does not load in time to be saved/printed", this should not happen generally since Forms print happens after page is fully loaded. I think it would be easier to resolve this issue rather than try to populate custom field without script.

0 0
replied on February 27, 2018

Hello, 

I can confirm that none of the JS in this form appears in the final saved form; To be clear, I'm more concerned with the PDF that is outputted via the "Save to repository" task or attached to an email notification than the printed output.

Essentially, within the collection layout, a Custom HTML field is replaced with a table via script. When the input fields inside the custom table are changed, the data is saved delimited to a hidden multiline field, also in the collection. When the form loads, each collection row looks for data in the multiline field, and populates the table rows if it sees anything.

There is also a design element to the form that is rendered via JS, non-essential, but clearly does not render in time to show up in the final printed/saved.

Could it be that the printed version will render the JS, but not the saved version? The saved version appears to follow the CSS @media print rules, rather than screen for instance, but this may be unrelated to how JS renders. 

Thanks for your help.

0 0
replied on February 27, 2018

If the "saved version" means the file that is saved to repository, what is the "printed version"? Printed through browser?

All custom script would run on the saved version, but you need to make sure the script has been designed for the read-only form: when form is saved, the form is in read-only style, like the form you could see on instance history -> view submitted form.

0 0
replied on February 28, 2018

For now, let's focus on the saved version. The printed version I'm thinking about is the output from the "Form Complete" page, which displays with the correct formatting and JS on screen, but does not seem to print correctly. In this form, we're not offering that option, so it is irrelevant for the moment.

Can you offer any direction as to what is required to make the JS work for a read-only form?

Thank you

0 0
replied on February 28, 2018

The major difference between new submission form and read-only form is that, all input elements are changed to div elements, so there should be separated script to handle them. You can refer to posts like https://answers.laserfiche.com/questions/125599/Saved-forms-not-displaying-correctly

You can check instance history -> view submitted form which is read-only form and make sure your script works on that page.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.