Live Forms Latest - This documentation is for Live Forms 8.0 Not for you? Earlier documentation is available too.

Skip to end of metadata
Go to start of metadata

The FAQs provide some examples and code snippets for common tasks when a third-party application wants to interact with the Live Forms server.

On this page:

How do I login and logout to and from a server?

See the Java code snippet below:

Since there is some overhead associated with logging in and out, you need to keep the FormsService instance around for as long as you need to interact with Live Forms before logging out.

How do I get the list of all applications for the current user?

How do I get the list of all themes for the current user?

How do I get the list of all forms for the current user?

How do I get the list of all forms for a given application?

The code snippet below prints the name of all forms in the appEntry application:

How do I get the list of all schemas for the current user?

How do I get the list of all schemas for a given application?

The code snippet below prints the name of all schemas in the appEntry application:

How do I get the url to a form so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

Then using the formUrl above you can generate the following script tag in your html page:

This will embed the form in your page inside an <iframe/>.

How do I get the url to the form designer so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

Then using the designerUrl above you can generate the following script tag in your html page:

This will embed the form designer in your page inside an <iframe/>.

How do I get the url to the form submissions so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

Then using the formSubmissionsUrl above you can generate the following script tag in your html page:

This will embed the submissions view in your page inside an <iframe/>.

How do I get a form entry based on a known id?

This is often needed when you need to relate an Live Forms form with another concept your application (e.g. you application has the concept of a report that has an associated Live Forms form). In this case you will store the form id somewhere and when needed fetch the form entry to embed it in your page, delete it, etc. Here is how you get the for a form entry (in fact any entry):

And here is how you can use that id to find the corresponding form entry:

How do I delete a form (or any other entry)?

By calling the delete method on the FormTypeEnty.

How do I create a new form?

First you have to get a hold of the form feed from an existing application. See How do I get the list of all forms for a given application?

Inserting the original newEntry will not update it, but instead a new entry will be returned.

How do I create a new form using an existing one as a template?

The only difference between creating a new form and creating a new one based on an existing form is that instead of using the entry created by calling 'ftFeed.createEntry()' you will be using an existing form entry. Find an existing form entry, update its name and description and use that entry to insert into a feed. Do not override the entry id otherwise the insert will fail.

How do I copy a form?

Copying entails inserting an existing entry into a feed. The key difference between this case and a regular feed insert() is that the entry being inserted already has an id: this will trigger a copy.

You can only insert into a feed that has an explicit owner, which is guaranteed above by getting the FormTypeFeed from the ApplicationEntry as opposed to getting a FormTypeFeed containing forms for all applications.

 

How do I download an existing form?

It is also possible to download a form using the API similar to the way you can download one from the UI. Consider the following code snippet:

How do I upload a form into an existing application?

You can also upload a form that was previously downloaded using the following code snippet:

How do I use Self-signed Certificates with the API?

One approach is to modify the client code to accept self-signed certificates, but the recommended method is to use the standard Java mechanisms to trust a self-signed certificate; for example, to add the self-signed certificates to the JRE trusted keystore.

  • Use a key tool to create a key
  • Used installcert.java to install the certificate in a trusted keystore
  • Save the keystore in the ''jre-home\lib\security'' directory
  • Restart the server

How do I set a form's Deployment State?

Why are deleted submissions showing up in the submissions feed?

The submissions feed will retrieve all type of submissions: submitted, saved, deleted (Deleted submissions are soft deleted meaning they are marked in the database as deleted, but the records are still present in the DB and they will be returned in the SubmissionFeed). The  Submissions UI page, by design, shows only the submissions which are completed.

Let's say you want to sort submissions that are saved versus those that are submitted. You can use the SubmissionEntry.getState() method. This will return the current state of a SubmissionEntry (SAVED or SUBMITTED). You can use this property to distinguish between your submissions.

How do I get a form submission PDF when Save PDF is not enabled?

Using Live Forms API, you can instantiate each form submission, get the PDF for that instance and then cancel the form instance. Note that the PDF will not show up in the form submission when using this approach as the instance is canceled.

Here is an example API script that will download PDF's for all form submissions to disc:

How do I batch upload users from the api?

The format of the users csv file is the same as that used through the UI CSV Upload of Users and Roles feature.

Users csv upload is through HTTP.  

The users csv upload is available directly through HTTP. One way to do this is using cURL, but other ways are possible. 

Here are the steps:

  1. Log in:

      2. Replace host, port, username and password above as correct for your implementation. For Live Forms online, host=app.frevvo.com and the port is optional. Change http to https.

If your tenant is on the frevvo cloud server, and you see the error "Couldn't open file "users.csv", perform one of the following actions:

  • Update the trusted certificate authorities present on your client machine
  • Disable the certificate check with the cURL -k option:

 

curl http://host:port/frevvo/web/login -d username=admin@tenant -d password=admin_password -d lAction=Login  -X POST  -c cookies -H Content-Type:application/x-www-form-urlencoded -k 

      3. Upload the users csv file:  

      4. Replace host, port, tenant.id, some_email_address and users_file.csv above as correct for your implementation. If users_file.csv is not in the current directory, adjust the path accordingly. For Live forms online, host=app.frevvo.com and port is optional. Change http to https.

      5. Check the some_email_address for incoming email with the results of the load.

      6. (Optional) Get the user csv back from frevvo. It will have all users, including all that were loaded:

For Live forms online, host=app.frevvo.com and port is optional. Change http to https and add the -k option

7. The response will be the users csv data.

Users csv upload through the Java data api

The users csv upload is available through the Java data api in Live Forms v6.1.4+. Here is the code snippet:

To get the users csv data from frevvo:

You can specify who receives an email reporting the upload status when it is done through the API. The email is sent to the "notificationEmailAddress" that is passed in the API. The email may say something like this if there are errors during the upload:

The attached file, results.csv, will contain the details.

  • No labels