Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

Overview

This advanced example is about a custom scripting based way to provide dynamic column selection. This is based on the Column Selection examples and assume you have followed those steps first. We use a simple table to make it easier to demonstrate the scripting.

Tip
titleExperience required

Skills - if you do not have the following skills, do not attempt this example. Learn the basics separately and then come back here.

  • You should already be experienced with some form of scripting like with groovy
  • You should be familiar with using the Run macro and using checklist input fields
  • You should have a bit of understanding of wiki markup
Column
width40%

Screenshot

 

Requirements

Run Macro Configuration

  • Likely you will want to select Automatically render body on display (autoRun) so the table will be displayed with the default columns initially
  • Add a checklistfieldcalledcolumns to the Replace field list (replace) that contains pairs matching column numbers to column names

Table plus
autoNumbertrue
DescriptionExample

Add a checklist field called columns to the Replace field list (replace) that contains name/value pairs matching column numbers to column names

columns:'1,2,3':Column selection:checkbox:1:1:A:2:B:3:C:4:D:5:E

Likely you will want to select Automatically render body on display (autoRun) so the table will be displayed with the default columns initially

select Automatically render body on display 
 

Script

The script will need to be customized for your specific use. This is just a simple example. The groovy macro needs to set the Output format (output) to wiki.

...