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.
These 2 APIs are available at the following URLs:
File format | API URL | Method |
---|---|---|
Excel 97-2004 (xls) | https://YOUR_CONFLUENCE_SERVER/ajax/confiforms/rest/excel-2json.action | GET |
Excel (xlsx) | https://YOUR_CONFLUENCE_SERVER/ajax/confiforms/rest/excel2007-2json.action | GET |
Services expect/support the following parameters:
Parameter | Description | Type | Required |
---|---|---|---|
attachmentId | Attachment ID of the Excel file attachment to use as source | Numeric | Yes |
skipRows | Number of rows to skip (from the top). Defaults to 0 rows to skip | Numeric | No |
idCellNum | Which column to use as ID | Numeric | No |
labelCellNum | Which column to use as label | Numeric | No |
Column and rows numbering starts with 0
NB! Only first sheet in excel file is currently supported!
Examples:
Last example reads ALL the rows and columns (skipping just the first one) and creates a structure similar to the one listed below
Code Block |
---|
[ { "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
View 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
ConfiForms Form Definition | ||
---|---|---|
| ||
Attachments |
---|