Picture from a public URL

The following dataset is used in the example below that shows how to insert a picture into an ODT report.

Data

{
  "flags": [
    {
      "name": "France",
      "picture": "https://share.ninox.com/rpke1sw0nyqapyk9eziw3axrk8pxyg0tc9a2"
    },
    {
      "name": "Germany",
      "picture": "https://share.ninox.com/suy1fumutu8c5dqqj328d9vuy9dohumu99it"
    },
    {
      "name": "Italy",
      "picture": "https://share.ninox.com/dvebk5n7j0bkecz6asvqsjz42bm6cf5couhb"
    }
  ]
}
  1. Insert a temporary picture in the template.

  2. Write the marker {d.logo} in the alternative text of the picture.

  3. To access the alternative text on LibreOffice: Right-click the Image > Format... > Text Alternative.

This replaces the temporary picture by the one linked in the "logo" data. After the document is rendered, the new image from the URL appears on the report. It is also possible to display a list of pictures by writing a loop.

For this example, we set up a database in Ninox that contains a table like the one shown below. The flag preview is optional and is for illustration purposes.

Step 1: Insert the first repetition marker on the description of the first picture

Step 2: Insert the second repetition marker [i+1] on the second picture

Then, save the ODT report in LibreOffice.

Step 3: Create a new layout in Ninox

Click the plus icon to create a new layout. Select Dynamic, then click the Import icon. Select the ODT report (here: Flag images report.odt). Once the file is uploaded, click the Create button.

Step 4: Insert custom JSON data in formula editor

On the right side, toggle Custom JSON on. Then click the formula field under JSON data input. The formula editor opens.

Paste the Data, then click the Save button.

Step 5: Download the PDF report

Click the Print icon and select This record to download a PDF preview.

After the document is rendered, the list of images appears on the PDF report:

Last updated