<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>About Radio Button and  Check box</title><link>https://community.appian.com/discussions/f/appian-community-edition/33944/about-radio-button-and-check-box</link><description>Now I am typing correct answer but i want like I want to select answer if one answer then it must come in radio button to select the correct answer and if multiple answer means check box must to select multiple answer and in data all questions are mixed</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128868?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 10:06:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9668178-3010-409a-a185-444e2462755e</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;In the foreach evaluation for your choice values and choice labels, get the values by using wherecontains. You have to get the answers related to your question so use the Parent data identifier to search the answers and it will automatically give you what is need.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
    items: local!question,
    expression: a!boxLayout(
      label: fv!item.Question,
      contents: {
        a!textField(
          value: if(
            fv!item.isMultiple,
            &amp;quot;Multiple Choice&amp;quot;,
            &amp;quot;Single Choice&amp;quot;
          ),
          readOnly: true
        ),
        if(
          fv!item.isMultiple,
          a!checkboxField(
            choiceValues: index(
              local!answers.id,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            choiceLabels: index(
              local!answers.Answers,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            
          ),
          a!radioButtonField(
            choiceValues: index(
              local!answers.id,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            choiceLabels: index(
              local!answers.Answers,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            
          )
        )
      },
      marginBelow: &amp;quot;MORE&amp;quot;,
      style: &amp;quot;ACCENT&amp;quot;
    )
  )&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;you can see how it is used in the choice values and choice labels of the components&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128867?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 09:51:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6c54b9ec-fdf8-4e7d-b219-142fc3721aeb</guid><dc:creator>akhilap</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/67/pastedimage1706953528452v1.png" alt=" " /&gt;&amp;nbsp;&lt;span&gt;I have got it but one thing i got stuck how you gave options seperately in radio button means&amp;nbsp;&lt;br /&gt;a)&lt;br /&gt;b)&lt;br /&gt;c) like this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128866?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 09:48:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:360b8266-6804-442c-800c-0743e8b1fe96</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Great! Please verify the answers which have worked for you. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128865?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 09:47:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:854e6e2f-b9b2-4ac1-9f82-2419acc051a7</guid><dc:creator>akhilap</dc:creator><description>&lt;p&gt;Thank you for your Quick Responses It was very Useful&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128864?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 09:45:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:edec682f-6c3c-4edb-844b-7626f7250e4a</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;In question Data base you will have below columns (You can add more as per your requirement)&lt;/p&gt;
&lt;p&gt;QUESTION_ID (PRIMARY KEY)&lt;/p&gt;
&lt;p&gt;QUESTION_VALUE&lt;/p&gt;
&lt;p&gt;QUESTION_TYPE OR IS_MULTIPLE&lt;/p&gt;
&lt;p&gt;IS_ACTIVE&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In Answers Data base&lt;/p&gt;
&lt;p&gt;ANSWER_ID(PRIMARY KEY)&lt;/p&gt;
&lt;p&gt;QUESTION_ID(FORIEGN KEY)&lt;/p&gt;
&lt;p&gt;ANSWER_VALUE&lt;/p&gt;
&lt;p&gt;IS_ACTIVE&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128863?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 09:42:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9b641fe2-9477-4ee2-bb90-c7a75a8ef8c4</guid><dc:creator>akhilap</dc:creator><description>&lt;p&gt;Okok but now in question data base only i have to give options..?or in Answer database I have to give options&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128862?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 09:34:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a1f10b2c-fcc6-4f9c-8d34-a7b99109e170</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;You will have to map the Primary key of your questions DB to each of your answer in the Answers DB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128861?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 09:14:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2b48fe82-6980-42f0-9cb8-bf0af6cb4667</guid><dc:creator>akhilap</dc:creator><description>&lt;p&gt;if we created two&amp;nbsp; data bases then how to know which questions have which options and answers&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128860?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 07:45:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:095eb671-d565-44f1-a208-f5fc06f10ac1</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;It would be the same instead of using a map inside the local variable you call your rule. If it is a record you would have recordType references.&lt;br /&gt;In the below code the &amp;quot;isMultiple&amp;quot; defines whether the question has multiple answers or not.&amp;nbsp; I would recommend having two different data bases for questions and Answers. where in the Questions Table you will have a field to Identify whether your question has Multiple answers or a single one. In the answers Data base table you will have a field of the Primary key of Questions Table.&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!question: rule!CDT_myQuestions(isActive: true()),
  local!answers: rule!CDT_myAnswers(isActive: true()),
  a!forEach(
    items: local!question,
    expression: a!boxLayout(
      label: fv!item.Question,
      contents: {
        a!textField(
          value: if(
            fv!item.isMultiple,
            &amp;quot;Multiple Choice&amp;quot;,
            &amp;quot;Single Choice&amp;quot;
          ),
          readOnly: true
        ),
        if(
          fv!item.isMultiple,
          a!checkboxField(
            choiceValues: index(
              local!answers.id,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            choiceLabels: index(
              local!answers.Answers,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            
          ),
          a!radioButtonField(
            choiceValues: index(
              local!answers.id,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            choiceLabels: index(
              local!answers.Answers,
              wherecontains(fv!item, local!answers.questionId),
              null
            ),
            
          )
        )
      },
      marginBelow: &amp;quot;MORE&amp;quot;,
      style: &amp;quot;ACCENT&amp;quot;
    )
  )
)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/67/pastedimage1706946930013v1.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128859?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 07:37:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aea07620-64ed-4d0f-9a94-f221761161ef</guid><dc:creator>akhilap</dc:creator><description>&lt;p&gt;If the values we are taking from cdt not from record then&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128848?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 06:08:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f43536cf-344f-4d1f-9341-44490a585bd7</guid><dc:creator>venkatrea696188</dc:creator><description>&lt;p&gt;Just like Harshit suggested you need check for the Choices, I wrote a simple expression use it as reference for your implementation&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!questionsWithAnswers:{
    a!map(
      Question:&amp;quot;Where is TajMahal Located&amp;quot;,
      Options:{&amp;quot;Agra&amp;quot;,&amp;quot;Pune&amp;quot;,&amp;quot;Vizag&amp;quot;,&amp;quot;Delhi&amp;quot;},
      Answer:{&amp;quot;Agra&amp;quot;}
    ),
    a!map(
      Question:&amp;quot;Cities in India&amp;quot;,
      Options:{&amp;quot;NY&amp;quot;,&amp;quot;Paris&amp;quot;,&amp;quot;Vizag&amp;quot;,&amp;quot;Delhi&amp;quot;},
      Answer:{&amp;quot;Vizag&amp;quot;,&amp;quot;Delhi&amp;quot;}
    )
  },
  local!selectedAnswers,
  a!forEach(
    items: local!questionsWithAnswers,
    expression: {a!richTextDisplayField(
      value: concat(fv!index,&amp;quot;.&amp;quot;,fv!item.Question),
    ),
      if(
     count( fv!item.Answer)=1,
     a!radioButtonField(
       choiceLabels: fv!item.Options,
       choiceValues: fv!item.Options,
     ),
     a!checkboxField(
       choiceLabels: fv!item.Options,
       choiceValues: fv!item.Options
     )
     
    )}
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Radio Button and  Check box</title><link>https://community.appian.com/thread/128844?ContentTypeID=1</link><pubDate>Sat, 03 Feb 2024 05:58:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8ef1855d-495f-4ee6-abeb-e21d453fe16a</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;YOu must be having this identifier in your data somewhere whether it is a single-choice or multi-choice. So you can just check it in a condition and add the field? What problem are you facing in implementing this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>