Page tree

Versions Compared

Key

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

We use a so called "virtual field" - just an arbitrary field we set up with Registration Control. Why "virtual"? Because the field is not defined on the form via field definition, but is used in rules to "initiate" some action(s) and/or behavior

In this case we call it virtualField (could have any name) and our form has afield definition rule to lookup the value for the smart field in another form based on the value (preset) given to this virtual field




ConfiForms Form Definition
formNameformWithSmartField

mychoiceMy choice[29393329|formWithChoices|choice|true||]smartselect2

id:[empty]mychoice=[entry.id]choice:[entry.virtualField]Lookup and set valuevirtualFieldformWithChoices:this

ConfiForms Form Definition
formNameformWithChoices

choiceChoicetexttrue

Register choiceINLINE



Choices

ConfiForms TableView
formNameformWithChoices





Registrations Controls with preselects

preselecting via virtual field for choice 1

ConfiForms (FormView) Registrations Control
formNameformWithSmartField
presetValuesvirtualField=choice 1
embeddedtrue


preselecting via virtual field for another choice

ConfiForms (FormView) Registrations Control
formNameformWithSmartField
presetValuesvirtualField=another choice
embeddedtrue


Source code for the demo

(formnames have a postfix 1 in their names)

Code Block
<ac:structured-macro ac:macro-id="0641f421-d4d4-4d26-aeb8-52f9dea39393" ac:name="confiform" ac:schema-version="1">
        <ac:parameter ac:name="formName">formWithSmartField1</ac:parameter>
        <ac:rich-text-body>
          <p>
            <ac:structured-macro ac:macro-id="5dc30adb-32e5-44cd-9bf7-c6216a52cc39" ac:name="confiform-field-definition" ac:schema-version="1">
              <ac:parameter ac:name="fieldName">mychoice</ac:parameter>
              <ac:parameter ac:name="fieldLabel">My choice</ac:parameter>
              <ac:parameter ac:name="values">[29393329|formWithChoices1|choice|true||]</ac:parameter>
              <ac:parameter ac:name="type">smartselect2</ac:parameter>
            </ac:structured-macro>
          </p>
          <p>
            <ac:structured-macro ac:macro-id="23712e1c-8018-4a0c-95b4-84d129caf112" ac:name="confiform-field-definition-rules" ac:schema-version="1">
              <ac:parameter ac:name="condition">id:[empty]</ac:parameter>
              <ac:parameter ac:name="fieldName">mychoice=[entry.id]</ac:parameter>
              <ac:parameter ac:name="values">choice:[entry.virtualField]</ac:parameter>
              <ac:parameter ac:name="action">Lookup and set value</ac:parameter>
              <ac:parameter ac:name="actionFieldName">virtualField</ac:parameter>
              <ac:parameter ac:name="values2">formWithChoices:this</ac:parameter>
            </ac:structured-macro>
          </p>
        </ac:rich-text-body>
      </ac:structured-macro>
      <ac:structured-macro ac:macro-id="26e10a88-18a8-4b7a-ac1c-cd5d2b156238" ac:name="confiform" ac:schema-version="1">
        <ac:parameter ac:name="formName">formWithChoices1</ac:parameter>
        <ac:rich-text-body>
          <p>
            <ac:structured-macro ac:macro-id="f0555f32-c7c4-4e25-9771-ee612a5b6b92" ac:name="confiform-field-definition" ac:schema-version="1">
              <ac:parameter ac:name="fieldName">choice</ac:parameter>
              <ac:parameter ac:name="fieldLabel">Choice</ac:parameter>
              <ac:parameter ac:name="type">text</ac:parameter>
            </ac:structured-macro>
          </p>
          <ac:structured-macro ac:macro-id="5a34863e-b388-402b-8045-6c9cc844a520" ac:name="confiform-entry-register" ac:schema-version="1">
            <ac:parameter ac:name="registrationButtonLabel">Register choice</ac:parameter>
            <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
            <ac:rich-text-body>
              <p>
                <br/>
              </p>
            </ac:rich-text-body>
          </ac:structured-macro>
        </ac:rich-text-body>
      </ac:structured-macro>
      <p>
        <br/>
      </p>
      <p>Choices</p>
      <ac:structured-macro ac:macro-id="3006fb70-1d79-44ae-9663-e80a64c73a62" ac:name="confiform-table" ac:schema-version="1">
        <ac:parameter ac:name="formName">formWithChoices1</ac:parameter>
        <ac:rich-text-body>
          <p>
            <br/>
          </p>
        </ac:rich-text-body>
      </ac:structured-macro>
      <p>
        <br/>
      </p>
      <p>
        <br/>
      </p>
      <p>
        <br/>
      </p>
  
      <p>Registrations Controls with preselects</p>
      <p>preselecting via virtual field for <strong>choice 1</strong>
      </p>
      <ac:structured-macro ac:macro-id="66951458-49fb-42ae-b7ba-21c9c8998140" ac:name="confiform-entry-register" ac:schema-version="1">
        <ac:parameter ac:name="formName">formWithSmartField</ac:parameter>
        <ac:parameter ac:name="presetValues">virtualField=choice 1</ac:parameter>
        <ac:parameter ac:name="embedded">true</ac:parameter>
        <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
        <ac:rich-text-body>
          <p>
            <br/>
          </p>
        </ac:rich-text-body>
      </ac:structured-macro>
      <p>preselecting via virtual field for <strong>another choice</strong>
      </p>
      <ac:structured-macro ac:macro-id="d798e26e-24ea-445e-91d2-49df9a097089" ac:name="confiform-entry-register" ac:schema-version="1">
        <ac:parameter ac:name="formName">formWithSmartField</ac:parameter>
        <ac:parameter ac:name="presetValues">virtualField=another choice</ac:parameter>
        <ac:parameter ac:name="embedded">true</ac:parameter>
        <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
        <ac:rich-text-body>
          <p>
            <br/>
          </p>
        </ac:rich-text-body>
      </ac:structured-macro>