Sweet Forms - general information¶
Form designer¶
Create a new form¶
- To see the Form Designer submenu, you need to have the ‘form designer’ feature
- Open Form Designer and Create new
- A new window will open. Start by giving the form a name under the Form name and a page under Pages.
Import form
- Import a form that has been exported earlier by clicking the Import Form option.
- You will be presented with a dialogue where you can upload the exported form (a file with the file type .survey)
- Click ‘import form’ or ‘import and open’
See also
To export a form, go to the form template list, click the 3-dot menu, choose actions, click the 3-dot menu at the bottom and select “Export form”. The form will be downloaded. After downloading the form, it can be imported.
Form templates¶
You can access all the form templates existing in the system from the form template menu. You can open the form templates directly from the list, filter them or perform actions.
Available actions:
Export the form - this function exports the form to a .survey file which you can import to the same or another Sweet environment (a different version).
Delete the form - this function deletes the form and all the answers, you can’t undo this action.
Create copy - this function creates a copy of the form.
Export answers - this function generates an excel file with all the answers that have been received per form.
New form¶
General settings
You can see and edit the form name under the Form Structure.
You can access the general form settings under the ‘settings’ option below the form name. Different tabs have different settings for the form.
New form - general settings
Form structure
- Page - contains selections and questions. If two (or more) pages have been created, a ‘next page’ button will be shown in the preview.
- Section - consists of different questions. It can be set to a 1, 2 or 4 columns layout.
- Question - there are several types of questions that the user has to answer.
- Sub question - exists only on Matrix and List question type.
- Answer - different options are available for some question types, for example: single answer or multiple answers.
Function on the page and question structure
Buttons maximize or minimize the tree view.
Button displays a menu with more options for the specific part of the tree.
If the is shown, the row can be moved in the tree. Press and hold the pointer on the row to move it up and drown the tree.
If the question’s background is grey (when not hovered), it is active in the tree and the edit page to the right will show the settings for the active item.
Editing
The edit section will show the settings for the active page, questions, section or the form in general.
Automatic preview
The preview shows how the form looks at the moment and will update in real-time as you make new changes.
Form warnings
The validation displays all the errors that must be corrected before the form can be published.
Hover over the description and click on the error to navigate to the error in the form. Errors in the form structure are visible thanks to the red highlighted text.
Actions
Test the form - it opens the forms in a new window for you to test it
Publishing settings - it opens the ‘publishing settings tab’ where the user sees all the publishing possibilities
Save and close - it saves all the changes and closes the form designer (the form is not published)
Save - it saves the changes you have made in the form (the form is not published)
Create a new section or question in the form structure
- Click on the New section and type the section’s name
- Press enter
- The cursor will be automatically placed on ‘new question’
*You can use the tab key to move down the tree structure
Change settings for a section
- Click the section that you wish to edit
- In the edit section, you see all the settings for that section
- With the template options, you can style the section’s final looks
- The style option gives you more section styling options
Change settings for question
- Click the question that you wish to edit
- In the edit question, you will see all the settings for that question
- At this point, you can change the question type (there are different options for different questions types)
Score and colour¶
Under general Settings on the form, there is a tab called Score and colour. Under this tab, the user can define and add colours that will be available in the form. Click Add new colour button and select a colour from the colour palette and give it a name. Now colours created by the user will be available on the page, section, question and answer under the Score and colour tab. The user can define the colour of the answer for the whole page. If there are 2 different sections on this page, the user can define a new set of colours for answers in Section 1 and leave Section 2 with default settings set on the Page level. It is possible to change the colours of answers on individual questions.
Example on the bases of the image below.
- User adds a rule under the Score and colour tab on the page level saying that answers should be marked green.
- User adds a rule under the Score and colour tab on the section level (only section one), saying that answers should be marked red.
- User adds a different rule for colours on the Single answer question under Section 1.
Result:
All the answers on the page should be, by default, green if no other rule is set on the lower level of the tree form (section, questions). Because no additional rules were added to Section 2 - all the answers are marked green. In section 1 additional rule was added saying that all the answers should be marked red - for this reason, all of the answers under Matrix multiple answers 1 are marked red. Answers under the Single answer question have different colours because the special rules were set for this question on the answer level.
You can set a different score for different answers in the form. Every answer in the form has a tab called Score and colour. Here you can set a score and a predefined color to the answer. This can, e.g. be handy for risk analysis forms or other types of investigation forms. You can also display the current score for the user by adding a Show score question.
Question type¶
Single answer¶
The single answer question type requires at least one answer added to the question. The single answer allows the user to pick 1 answer only.
You can change the way the questions look. Below there are examples of the same questions with different answer styles.
Multiple answers¶
Multiple answers question type allows the user to pick 1 or more answers. The user can set the minimum and maximum allowed answers number for this question type.
You can decide how the questions will look in the form. Below there are examples of the same question with different answer styles.
File upload¶
The file upload question type allows the user to upload a file to the form. If the form is answered on a phone or tablet, the user can also take a photo and upload it.
You can decide the accepted file types and the maximum file size in the edit question settings.
Note
When e-signing is activated in the form, only the following file types will be accepted : .pdf, .jpg, .jpeg, .png, .bmp, .gif. All uploaded files will be converted to PDF since it is required for the signing process.
Free text¶
Free text part 1
This question type generates an input field for the user and is a default question type.
You can set validation rules and connect available data sources in the settings.
Validation
Using validation will let you decide what kind of format the input field should have. Different kinds of validations are available, for example: email, length, numeric and Regex (where you can create your own validation rule with Regex code).
You have to set an error text that will be shown when the field has the wrong formatting.
Free text part 2
With the free text question, you can connect available data sources that will automatically fill in data from somewhere else into the field.
As standard, you will have Sweet data sources available, but you can add your own data sources from different external systems with some integration.
To connect a Sweet data source to a free text question, you must first go to publish settings and choose the objects on which you want to publish the form. If you, for example, select Case, you will make the data source for Case available for your text field.
After choosing an object, you can go back to your free text question, click the data source tab and choose the field you want to connect.
By checking “Always get the latest data”, you will tell the form to populate the text field with data from the object every time you open the form.
If you do not check “always get the latest data”, the form will only fetch the data from the object once (the first time you open the form).
Checking “Save to the data source” will let you save the data from the form and update the field in the actual object. Note that the ‘save to the data source’ option is disabled on some data sources because those are not editable fields by users (for example, case name is editable but case number is not editable).
Note
Sweet data source functionality can be used only with the Free Text question type and Date and Time question type .
Free text multiple rows¶
This question type works exactly like the regular free text question but allows the user to write down several rows of text instead of 1.
Information¶
The information question type will display the text you write in the description section for the question.
In this field, you can also write HTML and inline-CSS, allowing you to create designed content instead of only plain text.
List¶
The list question type will create a row with one or more sub-questions. Note that the List question as an independent question does not work. It always needs to have at least one sub-question. These sub-questions can be the following types:
1.Single answer
2.Multiple answers
3.Date and time
4.Free text and Free text multiple rows
5.Information
6.File
7.Code group
Under appearance, you can choose to display the list as a table or as the default layout. See examples below.
You can select how many rows should be added per default when the user opens the form under the Pre added rows settings.
Under the answer rules, you can set how many rows that need to be added. Here you can set both a minimum and maximum value.
Date and time¶
This question type generates a calendar field where the user can set a date and time into the form.
You can choose to show only date, only time or both date and time in the settings.
Date interval¶
This question type generates a calendar field where the user can set a date and time interval.
In the settings, you can decide to show time or not.
Code group¶
Code group part 1
The code group type creates a drop-down field in the form. To this field, you can connect a Code group from Sweet that will be displayed as answers.
This can be useful if you have several questions with the same answers and want to manage the answers from one place. This function works across different forms as well.
To set up this question type, you must go to the Codes admin under Admin –> Metadata.
From the list, you choose a code you want to add to the form. Now you will see the whole code group and all of its codes. Copy the code group key by selecting all text (in the key) except the last dot and the part after the dot (see below).
Code group part 2
You can open your form and paste the key into the Code group key field under the question settings. Press the button to load the code group into the form.
Note that if the code does not have a caption, the key will be shown instead, see the example below.
Question type - Matrix¶
On the matrix question type, you can define both answers and sub-questions.
There are two types: Matrix single answer and Matrix multiple answers.
Show score¶
This question type will display the current score of a form through a donut chart.
For this question type to work, you need to use the Score functionality on at least 1 question in the form.
Sign¶
The sign question type creates a field where the user can sign with the finger, touch pen or mouse pointer.
The user can clear the signature to redo it or lock it when the signing is done. This will lock all the forms’ answers with the “Lock on sign” checked in the settings.
Number¶
The number type question can be used with 2 templates, Spinner or Number (the templates are placed under Appearance on the Edit question view). The user can select the number range under Settings on the Edit question view and add the minimum and maximum value to the question.
Visibility rules¶
How to apply visibility rules¶
Depending on the user’s answers, you can easily hide or show pages, sections or questions in the form. Below is an example explaining how to do this.
Visibility rules on the Single/Multiple answer question (also Matrix)
- Be sure to have a question that should trigger the visibility rule. E.g. a single answer question with some answers.
- Go to the part of the form you want to show or hide, depending on the user’s answer. This can be a page, section or question. Note that this part has to be somewhere after the trigger question in the form. Click in the visibility tab.
- Let’s say we want only to show this part of the form when answer 2 is chosen. In this case, drag n drop “Answer 2” from the tree structure to the left into the grey area in the Visibility tab. You have created a condition for the visibility rule.
- Now, that part of the form will only show if Answer 2 is chosen.
You can also negate the rule that you just added. This means that the opposite will be true – the part will only show if Answer 2 is not chosen.
You can do this by hovering over the condition and clicking the crossed equality sign icon.
You can apply as many conditions as you want to a visibility rule by dropping more answers to the condition area.
If you have more than one condition, you can decide if all of those conditions need to be fulfilled or if it’s enough with any of them. To change this, hover over all conditions should be met, click the 3 dot icon and choose any condition should be met.
Both Answer 1 and Answer 2 will trigger the visibility independent of each other.
Both Answer 1 and 2 need to be answered to trigger the visibility.
Visibility rules on the free text question
The user can add visibility rules to question-type free text. In this scenario, there is the pop-up where the user can
- leave the field empty - any answer will trigger visibility rules
- add the exact answer which has to be given to trigger the visibility rules
Note
In the case of other question types than Single/Multiple and Free Text questions - the user cannot choose the exact answer in the pop-up. This means that the visibility rule will only depend on whether the question has any kind of answer or was left empty.
Data sources¶
Freetext, Freetext multiple rows and Data and Time question type can be connected to data sources. This function populates data from an object in Sweet to the form.
Moreover, data can be updated from the form to the object.
To enable data sources, you need to have at least one Freetext or Date and Time question type and choose at least one object to publish the form on under the publish settings tab.
Data sources - set up¶
- Be sure to have a Freetext or Data and Time question type in the form
- Go to publish settings and click on the object(s) on which you want to publish the form.
- Go to your Freetext/Data and Time question and open the Data sources tab. Here you will see a list of all available data sources.
- Expand the data source you want to use. You will see a list of all the fields on that data source.
- Select the field you want to use. The field is now connected to the Freetext/Date and Time question type.
- If you click “Always get the latest data”, the form will check if the data from the object has been updated every time you open the form. If the data has been updated since last time, the form will populate that data instead. If this option is left unchecked, the form will only populate the data from the object the first time you open the form.
- Click “Save to data source” to update the field on that object directly from the form. If the information is updated in the form, it will also be saved to the object.
External data¶
The external data functionality allows you to populate external data in the form (through Sweet Automation). The user will then be able to search for data through a search field, and the result will be populated in chosen fields in the form. External Data functionality is not visible in the Form Designer preview.
When you have an account, you can easily connect Sweet Automation as an external data provider by adding the correct credentials under Admin > Connections.
- Add external data setup. More than one can be added
- Available connections
- Available selections within the chosen connection
- Name of setup *optional
- Search field settings. Here you choose what field the user will search for, e.g. organisation nr.
- Clicking this check box allows you to add a static value that the connection will use to search for results. Value is set in field 7.
- If the static value is unchecked, you drag & drop a free text field from the tree structure to use it as input for the search.
- Adds another search condition.
- Specify how many search results you want to fetch. If there is more than 1, you should use free text fields inside a list question to show more than one result.
- Mapping of search output. The available fields are displayed in the drop-down. You match the fields in the form with the output by dragging & dropping free text questions from the tree structure.
- Adds another search output row
- Removes the external data setup.
Example:
The user who answers the form can search for the Company organization number in the first free-text field. This functionality is specified under the Matching settings.
The organization search free-text field has a validation for org nr.
The result is set to show only 1 result per search. If we want to show more than 1 result, we need to use a list question with free-text fields.
The result’s output is set to show: Company name, Address, County and Zip code. The result is mapped to corresponding fields in the form (see arrows)
Once the user types in a correct org nr in the form, the search will begin and populate the result in the mapped fields
It is recommended to use the validation on the search field connected to the external function in order to guarantee the correct search input.
You add the validation as usual on the free text field you have chosen to use as ‘search’ in the external data settings.
The search will trigger as soon as the field is validated. Therefore, using the “Validate when leaving the field” can be good practice so that the search won’t trigger as soon as the user types a character in the input field.
Once you have configured your external data, you must publish your form to activate and test it.
Publish a form¶
When you are ready to publish a form, go to ‘publish settings’ by clicking the button at the bottom or Settings > Publish settings.
- Checkbox to publish the form
- Publish the start and end date (optional)
- This functionality prevents the user from opening the specific answer set when the corresponding form version is unpublished. (Form has version 1 and the corresponding answer set version 1. If Version 1 of the form is unpublished, the user cannot access answer set version 1 even though version 2 of the form is published)
- This functionality allows the user to open the specific answer set only once when accessing the form with the direct link (for specific security reasons).
- This functionality prevents the user from opening the specific answer set after it is finished.
- This functionality prevents the user from opening the specific answer set after the expired decided validity period.
- A list of objects in Sweet that you can publish the form on
- A list of all versions of the form
- Checkbox determinating for which version the form should be published
- Publish the start and end date
- Dates when the form version was published and unpublished
- Buttons to test the form version
Published version logic
If you have several versions of a form, you can choose which version should be published. The URL to the form will always point to the latest version of a form set to be published (2). E.g. if both versions 2 and 3 are set to be published, the URL will go to 3rd version of the form
Form links
- Displays the ID of the form
- URL to the latest published version of the Form - the URL generated by this link will always create a new answerSet. Click the link in Form Designer, copy the URL from the browser and paste it into another browser and a new answerSet is opened.
- URL to the latest published version of the Form - the URL generated by this link will always open the same asnwerSet. Click the link in Form Designer, copy the URL from the browser and paste it into another browser and the same answerset is opened.
Create a new version of the published form¶
As soon as someone has opened a published form answer set, you need to create a new version of that form if you want to add any changes to it.
You will notice when you open the form template again that it is locked.
Click the Create new version button to create a new version and unlock the form for editing.
When you click Create a new version, you will see a dialogue asking if you want to unpublish the previous active version.
Yes = The current published version will be unpublished. The form will become available for users when you publish the new version.
No = The current published version will still be published and available for users. When you decide to publish the new version, the form will be replaced by the latest version.
Note
The form designer can change the default name in the browser tab - Sweet Forms to any name under Settings - Texts Tab
CAPTCHA¶
As a form designer, you can use Captcha as an additional security method before validating the form. CAPTCHA stands for the Completely Automated Public Turning test to tell Computers and Humans Apart. The tool is used to differentiate between real users and automated users. The method provides challenges that are difficult for the computer but easy for humans.
Require Captcha functionality is available under Settings - Form - Answer sets. When the functionality is turned on, the user will be asked to complete a text-based or image-based task before completing the form.
Note
Captcha Connection has to be set before the user can use this functionality. This is done under Admin - Connections. Sweet system has support for Google reCAPTCHA v2.
Finish text and redirects¶
Finish text - form designer can add a ‘finish text’ to the form and the text can be styled with the help of the HTML editor.
URL when form is completed - the end user will be redirected to this page after clicking on Finish and Lock button.
URL when form is closed, but not completed - the end user will be redirected to this page after clicking Close and not completing the document.
URL when form is signed (e-signing) - the end user will be redirected to this page after signing the document at the signing provider web.
Example:
- open Form Designer and create new
- create a form with e-signing
- under Finish text and redirect, add the info as on the image below
- publish the form, open the link
- if the user clicks on Close on the form - the form is closed and the user is redirected to the Releye webpage
- if the user fills in the form and clicks on Sign - the pop-up confirming that the answers will be locked is shown. When a user clicks on Yes - the user is first redirected to the Finish text page. After clicking ‘ok’ on the ‘finish text’, the user is redirected to the Google page.
- if the user opens the link to the form from the email (Invitation email under e-signing settings) and signs the document on the signing provider page, the user is redirected to Sweet System’s web page
Note
If there is no redirect to the e-sign provider directly from the form -> The user should be redirected to the URL added in “URL when form is completed” under the tab “Finish text and redirects”.
Note
If there is a redirect to the e-sign provider -> The user should not be redirected to the URL added under “URL when the form is completed” (even though there is a url added here). In this case, the user is only redirected to the e-sign provider.