File, display and device elements
This page covers three categories of the toolbox: Files (File, Signature, Photo), Display (Computed value, Text block, Image) and Device (Location, Barcode). For the common settings, see Common element, page and form settings.
The person uploads one or more files: an invoice, a report, a contract.
| Setting | Values | What it does |
|---|---|---|
| Accepted file types | 1–20 file types | The types that can be uploaded. Written as file type codes and added with Enter: application/pdf, image/jpeg, image/png. If empty, every type Defthand accepts can be uploaded. |
| Largest file (bytes) | Number | The largest size per file, in bytes. 5242880 for 5 MB. |
| Maximum files | 1–10, default 1 | The number of files that can be uploaded to this question. |
| Comment box, Comment label, Comment hint | Adds a comment box below the file. |
Whatever your limit, Defthand’s own upper limits apply: images at most 10 MB, documents and archive files at most 25 MB.
Forms with a file question:
- cannot be filled in without an internet connection (offline filling is turned off for them in the mobile app),
- cannot be shared with a public link.
Uploaded files are stored with the submission; people who can see the submission download them from the Attachments section.
Signature
Section titled “Signature”The person signs with a finger, a pen or the mouse. It has no settings of its own; turning on Required in the common settings is enough. The signature is stored with the submission as an image file. A signature also needs an internet connection.
Take a photo with the device’s camera or pick one from the gallery: a damage photo, a site photo.
| Setting | Values | What it does |
|---|---|---|
| Maximum files | 1–10, default 1 | The number of photos that can be taken. |
| Largest file (bytes) | Number | The largest size per photo. |
On a device without a camera, the question works like a file question that uploads a JPEG, PNG or WebP image.
Computed value
Section titled “Computed value”A read-only field that shows the result of an expression and writes it into the submission: a total amount, a number of days, an average score.
- Add the element. With the arrow in the toolbox you can choose the result type up front: text, number, yes or no, date, date and time, time.
- In the Data section, choose the Result type (required).
- In the Logic section, write the expression in the Calculated value box (required), for example
sum(kalemler[*].tutar). - If the result type is Number, set up how it is shown: Format (Whole number, Decimal, Currency), Currency, Unit, Decimal places, Thousands separator.
If the result of the expression does not match the type you chose, the designer warns you. The value is calculated again on the server when the form is submitted. For writing expressions, see Conditions, calculations and validation.
Text block
Section titled “Text block”Text that is not a question and is only to be read: an explanation, instructions, information, a personal data protection (KVKK) notice. It holds no answer.
You write the text in the Content (required) setting. The text can use headings, bulleted and numbered lists, bold and italic text, links and images; the answer to a question in the form can also be inserted into the text. The text is entered separately for each language of the form.
Example: a text block at the top of a work accident form that says “Bu formu kazadan sonraki 24 saat içinde doldurun. Yaralı varsa önce 112’yi arayın.”
Show a picture, a video or a YouTube video in the form: a sketch, a sample photo, a training video. It holds no answer.
| Setting | Values | What it does |
|---|---|---|
| Media | Image, Video, YouTube | What is shown. |
| File | Uploaded file | The image or video file (Choose an image). Needed unless the media is YouTube. |
| YouTube video id | Text | The id of the YouTube video, the part of the address after v= (e.g. dQw4w9WgXcQ). Not the full address. |
| Alternative text | Text (required) | A description for people who cannot see the image; screen readers read it out. |
| Image fit | Show it whole (default), Fill and crop | How the image fits into its area. |
Location
Section titled “Location”Takes the coordinates of where the person is: the point where an inspection was done, the scene of an incident. The browser or phone asks for location permission.
| Setting | Values | What it does |
|---|---|---|
| Largest location error (metres) | A number greater than 0 | If the accuracy the device reports is worse than this value, the location is not accepted; for example 50. If empty, any accuracy is accepted. |
The answer consists of latitude, longitude and accuracy. A location cannot be typed by hand; if the device cannot give a location, the question cannot be filled in.
Barcode
Section titled “Barcode”Scan a barcode or QR code with the camera: an asset number, a product code.
| Setting | Values | What it does |
|---|---|---|
| Placeholder | Text | The hint shown while the box is empty. |
| Formats | QR, Data Matrix, PDF417, Aztec, Code 128, Code 39, EAN-13, EAN-8, UPC-A | The code types to read. If empty, all of them. |
The answer is the text of the scanned code. On a device without a camera or scanner (for example in a web browser), the question appears as a text box where the code is typed by hand.