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.
In ConfiForms we have a number of integration points where you can supply the data from your database tables or views directly to ConfiForms.
One of such integrations is using the ConfiForms Field Definition Rules action called "Lookup and set a DB value"
The table we use for the demo is with following structure
id | name | link |
---|---|---|
1 | ConfiForms add-on for Confluence | https://marketplace.atlassian.com/plugins/com.vertuna.confluence.plugins.confiform/server/overview |
3 | Smart Templates & Pages nice app | https://marketplace.atlassian.com/plugins/com.vertuna.confluence.plugins.smart-templates/cloud/overview |
2 | ConfiDoc add-on for Confluence | https://marketplace.atlassian.com/plugins/com.vertuna.confluence.plugins.confirest/server/overview |
Here is an example on how to use it. We wil have a simple form which will lookup the plugin link from a database table based on user selection and will set it to the text field (actually a field type called "link" to make the value clickable, but the techniques are the same)
The field "choice" is of type "db dropdown" and link is of type "link"
The form looks like this
We will add a ConfiForms Field Definition Rules macro to the game
In storage format it looks like this:
<ac:structured-macro ac:macro-id="4b605c7d-bcdb-429d-874b-6a6817e17a79" ac:name="confiform-field-definition-rules" ac:schema-version="1"> <ac:parameter ac:name="fieldName">link=[entry.pluginlink]</ac:parameter> <ac:parameter ac:name="values">select link as "pluginlink" from cd_demo where id = [entry.choice.id]</ac:parameter> <ac:parameter ac:name="action">Lookup and set DB value</ac:parameter> <ac:parameter ac:name="onUserActionOnly">true</ac:parameter> <ac:parameter ac:name="actionFieldName">choice</ac:parameter> <ac:parameter ac:name="values2">7422036e-9a6f-4455-92d9-7140131fb9da</ac:parameter> </ac:structured-macro>
So what we do here...
we configure it to set the value of the result into a field called link
link=[entry.pluginlink]
Important note is what is this "pluginlink".. it is actually the column returned by the SQL lookup we configured (see the r)
select link as "pluginlink" from cd_demo where id = [entry.choice.id]