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

Question

Question

Add Form variable to Custom HTLM

asked on February 3, 2016

When I save a particular image (e.g. invoice) to the repository a workflow starts and adds a new form, complete with workflow data, to a user's Form Task list.

The requirement is for a hyperlink in the new form back to the original image.

I cannot use form field variables in Custom HTML; they don't work.  

e.g. <p><a href="http://localhost/laserfiche/DocView.aspx?db=Demo&docid={/dataset/Image_ID}" target="_blank">Open Invoice</a></p> 

What JavaScript is required to add a variable to Custom HTML?

e.g. <p><a href="http://localhost/laserfiche/DocView.aspx?db=Demo&docid=XXXX" target="_blank">Open Invoice</a></p>   

Where XXXX is the image ID and assuming the image ID is added as a field in the form.

0 0

Answer

SELECTED ANSWER
replied on February 5, 2016

Hi Peter,

The variable in the CustomHTML is initiated and rendered when form loads with the variable's last submitted value, so it won't change value when you fill in the form.

1 0

Replies

replied on February 4, 2016 Show version history

Hi there,

You need to have workflow service task to preset the Image_ID variable value before entering the user task, so that the variable value will show up.

0 0
replied on February 4, 2016

Thanks Abby,

It would appear that, even though there may be a default value for the field Variable or a value is added to the field before submission, the field token e.g. {/dataset/Image_ID} value does not exist until the form is Submitted.  After submission the token contains the variable value and can be used in Custom HTML etc.

If the Form is invoked by a workflow, the token becomes available.

As you say Abby a workflow service would do the same.

I have used JavaScript to add the field value to the token before submission.  It works fine.

 

0 0
SELECTED ANSWER
replied on February 5, 2016

Hi Peter,

The variable in the CustomHTML is initiated and rendered when form loads with the variable's last submitted value, so it won't change value when you fill in the form.

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

Sign in to reply to this post.