I want to pass a variable from one form to another form in a business process using javascript please.
Thanks
Priya
I want to pass a variable from one form to another form in a business process using javascript please.
Thanks
Priya
whatever trigger you choose to use, put this inside it:
window.location.replace("http://somewebpage.com/formlocation");
You can also build your URL to "pass" data to that other page. In the manual there's instructions on building URL's to prefill some fields.
Thanks. How do you get the URL of the second form please? When I publish, it gives only 1 url. I do not have the manual. Can you please send me that section to pass data please.
All manuals are here:
https://support.laserfiche.com/KB/1012253
You can't have multiple starting forms for a process, so you have no URL to link to. Since there's no URL generated until after a form has been submited for the next step in the process there's no way to send that back to the client for javascript to act on it.
To do this I believe you'd need to setup those forms as separate processes.
Thanks. If the second form is in a separate business process, how do u pass the variables to that business process without adding the variable in the query string please?
Hello Priya,
I know that Forms does not have any built-in features to pass information between forms that are in different business processes. There may be a way to do this with Javascript, but I haven't seen it before.
Can you provide some background on why you want to pass information between business processes? There may be an easier way to configure this.
We have a web service that authenticates the user. I am calling that web service using javascript on form load. If the user is authenticated, i want to show the form with the information retreived from the web service. If not, the user should not see the form. How do I acheive that please?
Hey Priya,
So let me state explicitly, that Javascript runs on the forms themselves, not the business process. As far as I know, there isn't a way to attach any Javascript to the process itself.
What you'll want to do is configure the process modeler in the Forms process modeler. You can configure outflow paths to initiate different user tasks containing different forms needing to be filled out. These outflow paths can contain logic such that when a field in a form is populated with one value "A", the next task will be User Task A. When that field contains value "B", the next task will be User Task B. Keep in mind, different user tasks can prompt users to fill out different forms.
If you're hoping to have a value in Business Process A determine the outflow path for Business Process B, that is not possible. Field data is kept for each individual business process. Once again, there may be other ways to configure this, but I'll need a summary of the process before I can suggest anything specific.
It looks like you have created several posts here on Answers all related to the same question. Please avoid doing this in the future as it causes a lot of confusion and duplicates the resources that we spend asking the question.
So are you looking for a way for Forms to display one form or the other? Or are you looking for a way to implement security?
Why are you using a web service to authenticate users and not the built in security?
Going against Rob a little on this one. You can manually set a processes URL on the processes "Publish" tab. Once you have that, you can then pass values to another process using a querystring. For instance, we have one form that user puts an ID number into and once it is submitted, it starts a Workflow that queries a 3rd party database for some values and puts them into our own database. Then an email is sent with the URL of the next form and is partially prepopulated based on the values passed through the querystring. Here is information from the Forms help documentation:
Q: Is it possible to pre-fill the fields on a form by passing in URL parameters? A: Yes, it is! You can add variable parameters onto the URL to a form. In order to do so, you'll need to know the variable name associated with the field you want to fill in, and have the link to that form. Once you have this information, build the URL with the following structure: base URL?variable1=value&variable2=value Replace variable1 and variable2 with the variable names of the fields you want to populate on the form, and replace value with the value you want to appear in those fields. Append other variables to the URL by inserting an & symbol followed by the variable name, as shown above. Note: Only the Single Line, Multi-line, Number, and Currency fields are supported with this feature.
Blake,
I have done what you suggested in the post about this. The problem I am running into is that sometimes an ampersand (&) will be used in the pre-filled field. This ruins the URL. Any suggestions for this?
Thanks
The & is denoted in a URL as %26. You would have to some how either get them changed in your source data or some how look for any & and change them to %26 in the URL when it sends it. If you are doing it in Workflow, Pattern Matching might be able to accomplish this for you.
Would someone show me what the URL would look like after the ?...http://servername/Forms/FormName? I am pulling First Name in a field - the variable is First_Name. Will this work dynamically or does this only work with a static value?
It would look like "http://servername/Forms/FormName?First_Name=Linda&Last_Name=Russell&Street_Address=555%20Live%20Spring". If you mean dynamically as in a Forms Service task can generate this, then yes. Note: Only fields outside of collections and tables can be populated via parameters. Address, radio button, checkbox, file upload, and signature fields cannot be populated in this way. There are ways around this limitation, but would require some custom javascripts.
Can you please share your thoughts on how I can populate table fields using this query string approach?
Anyone ever figure out how to pass variables to a URL when the variable contains the & symbol? That symbol separates the variables so it is throwing me off. Thanks!