In this tutorial we will demonstrate how to use a new feature of ConfiForms to construct dynamic filters over your stored data. The macro is called ConfiForms Dynamic Filter

As usual, let's start with a simple form. The form will have 3 fields


Field labelField nameType
My Text Fieldmytffieldtext
My Dropdown Fieldmydropdownfieldadvanced dropdown
My Text Areamytextareatextarea


Storage format

<ac:structured-macro ac:macro-id="45a7667b-79d4-4896-9830-705af8285cb8" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">f</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="580584ec-6e33-4fb0-bc98-8f50d55cfd01" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">mytffield</ac:parameter>
        <ac:parameter ac:name="fieldLabel">My Text Field</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="2a7dd6b1-30c4-4602-91eb-8753d391ddc1" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">mydropdownfield</ac:parameter>
        <ac:parameter ac:name="fieldLabel">My Dropdown Field</ac:parameter>
        <ac:parameter ac:name="values">false[1=one|2=two|3=three|4=four|]</ac:parameter>
        <ac:parameter ac:name="type">select2</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="7399797b-9c13-461b-a8eb-3a763673d5b3" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">mytextarea</ac:parameter>
        <ac:parameter ac:name="fieldLabel">My TextArea</ac:parameter>
        <ac:parameter ac:name="type">textarea</ac:parameter>
      </ac:structured-macro>
      <ac:structured-macro ac:macro-id="746fdd65-348b-4c8c-be60-b48044c67761" ac:name="confiform-entry-register" ac:schema-version="1">
        <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
        <ac:rich-text-body>
          <p> </p>
        </ac:rich-text-body>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>

Something like this


We will add some records into the form

Now it is time to bring in the ConfiForms Form Filter Control macro

Here is the macro, with the default settings it takes all the fields from the form and present them in a card view. You can easily change the layout of this, see below


The macro has been renamed from ConfiForms Dynamic Filter Control to  ConfiForms Form Filter Control macro

ConfiForms Form Filter Control macro supports custom layouts. If you wish to have a free text search with custom layout then add a ConfiForms Field macro inside the Filter Control macro body and set it's field name parameter to *

(wildcard)

But it does not work without a "view"... without "views" macros, such as CalendarView, ListView, TableView or CardView. 

Trying to use it without a view will result in a warning message

So we need a "view"

We will use the default ConfiForms TableView

However, for TableView and CardView you *MUST* enable support for filter in macro properties

Now we can use the filter


Very important note:

You have to set the type of view used with this filter in Dynamic Filter macro. We have not done it, because the defaul mode is "table"

But this setting in ConfiForms Dynamic Filter macro must reflect what type of view macro you are trying to use with this filter

(name of the form and page where the form is located must match in "view" and in filter)


Here is an example using the Dynamic filter with custom layout and using it  together with a ListView

  1. We have put ConfiForms Field macro inside the Dynamic Filter to force own layout and use only the fields we want
  2. We Enabled Filter for "list" (listview) in Dynamic Filter
  3. We created ListView with custom layout (ListView and CalendarView do not require filter support to be explicitely set, it is there by default. In TableView and CardView it is off by default to support clean tables and compatibility with COnfluence Chart macro)

Here is how it looks like on the page

Thank you for you time and reading this far. The tutorial now ends, but there is a bit more to explore in Dynamic Filter macro, such as: