Avatar

Correct answer by
Community Advisor

Hello @Ssb_94 

 

I believe you were trying to create an input form in the campaign.

 

You might have to change the data schema a little bit.

 

Here is the code for Dataschema

<srcSchema _cs="products (cus)" created="2021-09-23 02:21:35.877Z" createdBy-id="0"
           entitySchema="xtk:srcSchema" img="xtk:schema.png" label="products" lastModified="2021-09-23 02:28:27.038Z"
           mappingType="sql" md5="B97497674F60132FBAFCAC006EBC872F" modifiedBy-id="0"
           name="products" namespace="cus" xtkschema="xtk:srcSchema">

  <enumeration basetype="string" default="none" name="productCategory">
    <value label="None" name="none" value="0"/>
    <value label="sports" name="sports" value="sports"/>
    <value label="books" name="books" value="books"/>

  </enumeration>

  <enumeration basetype="string" default="none" name="productSports">
    <value label="None" name="none" value="0"/>
    <value label="cricket" name="cricket" value="cricket"/>
    <value label="hockey" name="hockey" value="hockey"/>
    <value label="football" name="football" value="football"/>
  </enumeration>

  <enumeration basetype="string" default="none" name="productBooks">
    <value label="None" name="none" value="0"/>
    <value label="B1" name="b1" value="B1"/>
    <value label="B2" name="b2" value="B2"/>
    <value label="B3" name="b3" value="B3"/>
  </enumeration>

  <element autopk="true" label="products" name="products">

    <attribute enum="productCategory" label="Product Category" length="30" name="productCategory"
               type="string"/>
    <attribute label="Product Name" length="30" name="productName" type="string"/>
  </element>
</srcSchema>

 

Here is the code for Input form:

<form _cs="products (cus)" created="2021-09-23 02:29:05.211Z" createdBy-id="0" entitySchema="xtk:form"
      img="xtk:form.png" label="products" lastModified="2021-09-23 02:36:52.748Z"
      md5="F44C7E157333DD53B1437FEA50580649" modifiedBy-id="0" name="products" namespace="cus"
      xtkschema="xtk:form">
  <container codepage="1252" colcount="2" label="General" type="frame">
    <input choiceButton="true" xpath="@productCategory">
      <enter name="onChange">
        <set value="0" xpath="@productName"/>
        <reset xpath="@productName"/>
      </enter>
    </input>
    <container codepage="1252" type="visibleGroup" visibleIf="@productCategory='sports'">
      <input enum="productSports" type="sysenum" xpath="@productName"/>
    </container>
    <container codepage="1252" type="visibleGroup" visibleIf="@productCategory='books'">
      <input enum="productBooks" type="sysenum" xpath="@productName"/>
    </container>
  </container>
</form>

 

Here is the preview of the options how they will appear in the form

Manoj_Kumar__0-1632364794156.png

 

Manoj_Kumar__1-1632364819330.png

 

 

Let me know if this worked for you.

View solution in original post