Child pages
  • Using Excel files as sources for ConfiForms fields

This is the documentation for ConfiForms Server/Data Center app

However, this might also work for ConfiForms cloud and in most cases it does. But please see this page to understand the differences between server and cloud versions of the ConfiForms app.

Since version 1.53.4 we have introduced couple of experimental APIs which help you to make a bridge between ConfiForms web-services backed fields and Excel files attached to your Confluence page.


3 services:


These 2 APIs are available at the following URLs:

File formatAPI URLMethod
Excel 97-2004 (xls)

https://YOUR_CONFLUENCE_SERVER/ajax/confiforms/rest/excel-2json.action

SINCE 3.14.5

/rest/confiforms/1.0/excel/{attachmentId}

GET
Excel (xlsx)

https://YOUR_CONFLUENCE_SERVER/ajax/confiforms/rest/excel2007-2json.action

SINCE 3.14.5

/rest/confiforms/1.0/excel2007/{attachmentId}

GET
CSV (default format)

https://your_confluence_server/ajax/confiforms/rest/csv-2json.action

SINCE 3.14.5

/rest/confiforms/1.0/csv/{attachmentId}

GET


Services expect/support the following parameters:

ParameterDescriptionTypeRequired
attachmentIdAttachment ID of the Excel file attachment to use as sourceNumericYes
skipRowsNumber of rows to skip (from the top). Defaults to 0 (rows to skip, from the top of the sheet)NumericNo
idCellNumWhich column to use as IDNumericNo
labelCellNumWhich column to use as labelNumericNo

lookupValue

Since 2.27.21 

Can supply a lookup value for the service to lookup. The subset returned will be filtered to match (as substring) the given valueTextNo

lookupField

Since 2.27.23

Limiting the matching logic to specific field (cell)

Example: cell1 to limit to cell1 value only. If not specified then the match for given lookupValue is done against the whole row (all cells)

TextNo

exactMatch

Since 2.27.24

You can set the search to use "exact match", by default (when exactMatch is unspecified or false) the search is done as text substring match (case insensitive)

BooleanNo

Column and rows numbering starts with 0

NB! Only the first sheet from Excel file is currently supported!


Examples:

https://YOUR_CONFLUENCE_SERVER/ajax/confiforms/rest/excel-2json.action?attachmentId=2195459&skipRows=1&idCellNum=0&labelCellNum=1

https://YOUR_CONFLUENCE_SERVER/ajax/confiforms/rest/excel2007-2json.action?attachmentId=2195460&skipRows=1

Last example reads ALL the rows and columns (skipping just the first one) and creates a structure similar to the one listed below

[
  {
    "cell2": "uno",
    "cell3": "in cell 3",
    "cell1": "1"
  },
  {
    "cell2": "duo",
    "cell1": "2"
  },
  {
    "cell2": "tres",
    "cell3": "here is cell three",
    "cell1": "3"
  },
  {
    "cell2": "four",
    "cell1": "4"
  },
  {
    "cell2": "five",
    "cell1": "5"
  },
  {
    "cell2": "six",
    "cell1": "6"
  }
]

From the following excel file

As you can see, we can create a JSON Array structure that perfectly fits our ConfiForms web-service enabled fields

So, here is how you can create a ConfiForms Form which uses this file and shows it's values in the dropdown


Configuration for ConfiForms looks like this

With "myvalues" field configured as web-service dropdown

We have defined new connection to use the above mentioned excel to JSON APIs


And set the mapping to use cell1 as ID column for the dropdown and cell2 as a label


And you can see the online results right here

All the registrations so far (and yes, we can access ANY other field, like cell3 in our views, see below)

Date created

My excel values

myvalues.id

myvalues.cell1

myvalues.label

myvalues.cell3

2022-09-13 16:57 duo c81e728d9d4c2f636f067f89cc14862c 2 duo
2022-10-09 12:13 five e4da3b7fbbce2345d7772b0674a318d5 5 five
2022-11-09 05:03 six 1679091c5a880faf6fb5e6087eb1b2dc 6 six
2022-11-14 11:31 four a87ff679a2f3e71d9181a67b7542122c 4 four
2022-11-16 16:59 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2022-11-21 18:02 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2022-11-21 21:19 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2022-11-22 00:48 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2022-11-30 03:29 duo c81e728d9d4c2f636f067f89cc14862c 2 duo
2022-12-13 10:53 four a87ff679a2f3e71d9181a67b7542122c 4 four
2022-12-13 10:59 six 1679091c5a880faf6fb5e6087eb1b2dc 6 six
2022-12-13 10:59 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2022-12-14 12:24 six 1679091c5a880faf6fb5e6087eb1b2dc 6 six
2022-12-14 12:24 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2022-12-16 03:05 four a87ff679a2f3e71d9181a67b7542122c 4 four
2022-12-22 14:22 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2023-01-05 08:51 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2023-01-20 18:05 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2023-01-26 14:38 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2023-01-31 10:10 duo c81e728d9d4c2f636f067f89cc14862c 2 duo
2023-02-08 16:53 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2023-02-16 06:55 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2023-02-20 15:57 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-02-28 14:29 duo c81e728d9d4c2f636f067f89cc14862c 2 duo
2024-03-06 09:18 duo c81e728d9d4c2f636f067f89cc14862c 2 duo
2024-03-11 14:57 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-04-18 03:16 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-04-18 03:17 tres eccbc87e4b5ce2fe28308fd9f2a7baf3 3 tres here is cell three
2024-04-26 17:09 tres eccbc87e4b5ce2fe28308fd9f2a7baf3 3 tres here is cell three
2024-05-04 00:40 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-05-08 14:09 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-05-15 11:46 tres eccbc87e4b5ce2fe28308fd9f2a7baf3 3 tres here is cell three
2024-06-18 11:48 six 1679091c5a880faf6fb5e6087eb1b2dc 6 six
2024-07-03 18:43 duo c81e728d9d4c2f636f067f89cc14862c 2 duo
2024-07-03 18:43 four a87ff679a2f3e71d9181a67b7542122c 4 four
2024-07-04 13:05 duo c81e728d9d4c2f636f067f89cc14862c 2 duo
2024-07-05 13:33 five e4da3b7fbbce2345d7772b0674a318d5 5 five
2024-08-21 07:57 tres eccbc87e4b5ce2fe28308fd9f2a7baf3 3 tres here is cell three
2024-08-28 13:45 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-08-29 05:49 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-09-18 21:33 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-09-19 03:35 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-11-05 20:20 four a87ff679a2f3e71d9181a67b7542122c 4 four
2024-11-11 11:41 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-11-13 17:44 six 1679091c5a880faf6fb5e6087eb1b2dc 6 six
2024-11-24 12:32 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-11-24 12:33 six 1679091c5a880faf6fb5e6087eb1b2dc 6 six
2024-11-27 14:44 four a87ff679a2f3e71d9181a67b7542122c 4 four
2024-11-28 16:57 uno c4ca4238a0b923820dcc509a6f75849b 1 uno in cell 3
2024-11-28 16:57 four a87ff679a2f3e71d9181a67b7542122c 4 four