<?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>choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/discussions/f/rules/39094/choose-function-usage-with-rule-inputs-as-parameters</link><description>Hello, mates! 
 I would like to create a rule that will provide choices/options through parameters to be used with the choose() function ( https://docs.appian.com/suite/help/25.1/fnc_logical_choose.html ) 
 However, the choices will not have a default</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148026?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 16:00:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9207ea35-d941-4615-8919-eacf713c373f</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;I see, thank you and Harsha as well. I guess I will just componentize the tabs, and use a rule input to store the index back to the whichever main interface use the component, that should work like:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*ri!tabs: (Array of Text)*/
/*ri!activeTab: (Integer store the active tab through index)*/

a!localVariables(
  a!cardLayout(
    contents: {
      a!cardLayout(
        contents: {
          a!columnsLayout(
            columns: {
              a!forEach(
                ri!tabs,
                a!columnLayout(
                  contents: {
                    a!cardLayout(
                      contents: {
                        a!richTextDisplayField(
                          labelPosition: &amp;quot;COLLAPSED&amp;quot;,
                          value: {
                            char(10),
                            a!richTextItem(
                              text: ri!tabs[fv!index],
                              color: if(
                                fv!index = ri!activeTab,
                                &amp;quot;STANDARD&amp;quot;,
                                &amp;quot;ACCENT&amp;quot;
                              ),
                              size: &amp;quot;STANDARD&amp;quot;,
                              style: if(fv!index = ri!activeTab, &amp;quot;STRONG&amp;quot;, &amp;quot;PLAIN&amp;quot;)
                            ),
                            &amp;quot;  &amp;quot;,
                            a!richTextIcon(
                              icon: &amp;quot;exclamation-triangle&amp;quot;,
                              showWhen: false,
                              color: &amp;quot;NEGATIVE&amp;quot;
                            )
                          },
                          align: &amp;quot;CENTER&amp;quot;
                        ),
                        a!cardLayout(
                          style: if(fv!index = ri!activeTab, &amp;quot;ACCENT&amp;quot;, &amp;quot;NONE&amp;quot;),
                          padding: &amp;quot;EVEN_LESS&amp;quot;,
                          showBorder: false
                        )
                      },
                      link: a!dynamicLink(value: fv!index, saveInto: ri!activeTab),
                      padding: &amp;quot;NONE&amp;quot;,
                      showBorder: false,
                      accessibilityText: if(
                        fv!index = ri!activeTab,
                        &amp;quot;Selected Tab.&amp;quot;,
                        &amp;quot;Unselected Tab. Press enter to select tab.&amp;quot;
                      )
                    )
                  },
                  width: &amp;quot;NARROW&amp;quot;
                )
              )
            },
            marginBelow: &amp;quot;NONE&amp;quot;,
            spacing: &amp;quot;NONE&amp;quot;
          ),
          a!cardLayout(padding: &amp;quot;NONE&amp;quot;)
        },
        padding: &amp;quot;NONE&amp;quot;,
        showBorder: false
      ),
      
    },
    padding: &amp;quot;NONE&amp;quot;,
    showBorder: false
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148023?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 15:48:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:664769af-4452-47e8-8f6f-53d27e38df86</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;I appreciate that, but it doesn&amp;#39;t meet my use case requirements for development utils.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148022?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 15:48:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f46e74e8-7f7e-47d1-9400-771fe98c0778</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Either way you&amp;#39;ll need to figure out a way to work within the system&amp;#39;s constraints - mainly here that there isn&amp;#39;t a supported way to call arbitrarily-named sub-interfaces (or other rules etc); whatever you want to use will need to be hardcoded into the parent interface.&amp;nbsp; You&amp;#39;ll have a lot better time if you architect it in such a way that you can use a limited set of sub-interfaces and parameterize the contents using tab-specific data you pass in (as needed).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148021?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 15:42:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9cfa71e0-ba4a-439d-87ea-8185e14da605</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;The tab layout will remain the same, but the names and the contents will be different. I don&amp;#39;t have the differences mapped, I am just just trying to make that possibility come true, so other mates can utilize for different contents and lengths as a component, that is it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148020?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 15:34:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:561c96a0-fb83-4fc8-ab4e-3d8c70a667ab</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Just as you would need to manually create all rules &lt;em&gt;rule!APP_content_&lt;strong&gt;X&lt;/strong&gt;()&lt;/em&gt; for &lt;em&gt;&lt;strong&gt;X&lt;/strong&gt;&lt;/em&gt; = 1....&lt;em&gt;&lt;strong&gt;n&lt;/strong&gt;&lt;/em&gt;, you would need to hardcode them into your calling interface in some way or another.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;a!match()&lt;/em&gt; provides far greater flexibility than &lt;em&gt;choose()&lt;/em&gt; in that you don&amp;#39;t strictly need an array of strictly &lt;em&gt;&lt;strong&gt;n&lt;/strong&gt;&lt;/em&gt; parameters passed into it, but can instead handle anything up to and including &lt;em&gt;&lt;strong&gt;n&lt;/strong&gt;&lt;/em&gt;.&amp;nbsp; But it doesn&amp;#39;t, per se, buy you the ability to avoid hardcoding interface names that you need to call.&lt;/p&gt;
&lt;p&gt;(But you might want to look at making all or some of these interfaces programmatic, meaning they share the same interface but act differently depending on a parameter you pass in - if possible, which of course I can&amp;#39;t say for sure since I don&amp;#39;t know how different they all need to be.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148019?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 15:32:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f1cc32a6-925d-496b-b900-788fb51e9b1f</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;You need to figure out&amp;nbsp;at most how many tabs can be there when either all conditions are passed or none applied.&lt;/p&gt;
&lt;p&gt;If you can have at most 7 tabs then your match() needs to be configured with all 7 possibilities. Assign one unique index to each tab so that if dynamically only 4 tabs (e.g. Tabs 1,3,4 and 7) are selected, the indexes replicate the same.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If it easier you can also go with strings to match the selected tab with content instead of index.&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!selectedTab: &amp;quot;Tab2&amp;quot;,
  a!match(
    value: local!selectedTab,
    equals: &amp;quot;Tab1&amp;quot;,
    then: a!stampField(
      labelPosition: &amp;quot;COLLAPSED&amp;quot;,
      icon: &amp;quot;angle-down&amp;quot;,
      contentColor: &amp;quot;STANDARD&amp;quot;
    ),
    equals: &amp;quot;Tab2&amp;quot;,
    then: a!stampField(
      labelPosition: &amp;quot;COLLAPSED&amp;quot;,
      icon: &amp;quot;angle-up&amp;quot;,
      contentColor: &amp;quot;STANDARD&amp;quot;
    ),
    equals: &amp;quot;Tab3&amp;quot;,
    then: a!stampField(
      labelPosition: &amp;quot;COLLAPSED&amp;quot;,
      icon: &amp;quot;angle-double-up&amp;quot;,
      contentColor: &amp;quot;STANDARD&amp;quot;,
      backgroundColor: &amp;quot;NEGATIVE&amp;quot;
    ),
    default: &amp;quot;No Priority&amp;quot;
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148018?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 15:29:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:896c0953-4959-4efd-9f65-1133b2e43880</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/5722.pastedimage1747063727089v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148016?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 15:25:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7e24b4e8-4ab7-491e-9864-d6c5a538db74</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;My component should be something like&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
  /* Example 1 */
  rule!App_TABS(
    tabs: { &amp;quot;TAB 1&amp;quot;, &amp;quot;TAB 2&amp;quot;, &amp;quot;TAB 3&amp;quot; },
    contents: {
      rule!APP_content_1(),
      rule!APP_content_2(),
      rule!APP_content_3()
    }
  ),
  
  /* Example 2 */
  rule!App_TABS(
    tabs: { &amp;quot;TAB 1&amp;quot;, &amp;quot;TAB 2&amp;quot;, &amp;quot;TAB 3&amp;quot;, &amp;quot;TAB 4&amp;quot;, &amp;quot;TAB 5&amp;quot; },
    contents: {
      rule!APP_content_1(),
      rule!APP_content_2(),
      rule!APP_content_3(),
      rule!APP_content_4(),
      rule!APP_content_5(),


    }
  )
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The reason is that I want it to become an utility rule.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148014?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:51:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6dc7df24-ccf3-447d-a747-c31c1f8c533f</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="293911" url="~/discussions/f/rules/39094/choose-function-usage-with-rule-inputs-as-parameters/148013"]The issue is that the length should be dynamic, through parameters[/quote]
&lt;p&gt;How do you plan to handle a dynamic length of tabs with a prescribed set of sub-interfaces?&amp;nbsp; There isn&amp;#39;t a way to dynamically generate (named) interfaces.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148013?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:49:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0e891027-ddd0-4a0d-879a-0d1e284e19bc</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;The issue is that the length should be dynamic, through parameters. The length of it can vary. But anyways, I am kinda pessimist about this being able to do that right now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148012?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:43:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c0a0fcc0-ca0f-454e-afa5-910cf558ab4d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;If you&amp;#39;re calling different sub-interfaces, then of course they&amp;#39;ll need to be declared directly in the code for your parent interface.&amp;nbsp; I&amp;#39;m still a little shaky as to what your overall configuration looks like, but i&amp;#39;m guessing you can configure something along these lines:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!match(
  value: local!selectedTabIndex,
  
  equals: 1,
  then: rule!BBB_TAG_1(...),
  
  equals: 2,
  then: rule!BBB_TAG_2(...),
  
  [... etc],
  
  default: rule!default_tab()  /* use for default or invalid selection, etc */
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148011?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:37:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ffa6985-1560-47cd-afab-9de9006593a4</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;it needs to be exactly that code, an interface code, which will be on different rules of course, it is supposed to be named like rule!BBP_TAG_1 for example. It is not my real example actually, however I believe I&amp;#39;ll get some hint through it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148010?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:35:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8b715eb5-c291-4bca-93eb-ed2d8ad02da5</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;What&amp;#39;s the source of the available indexes, and where/how will the individual tab contents be configured?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148009?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:35:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eb49d5e2-03c6-4644-b28d-1613249eed42</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
  a!tagField(
    labelPosition: &amp;quot;COLLAPSED&amp;quot;,
    tags: {
      a!tagItem(
        text: &amp;quot;TAG&amp;quot;,
        backgroundColor: &amp;quot;ACCENT&amp;quot;
      )
    }
  ),
  a!tagField(
    labelPosition: &amp;quot;COLLAPSED&amp;quot;,
    tags: {
      a!tagItem(
        text: &amp;quot;TAG 2&amp;quot;,
        backgroundColor: &amp;quot;NEGATIVE&amp;quot;
      )
    }
  ),
  a!tagField(
    labelPosition: &amp;quot;COLLAPSED&amp;quot;,
    tags: {
      a!tagItem(
        text: &amp;quot;TAG 3&amp;quot;,
        backgroundColor: &amp;quot;POSITIVE&amp;quot;
      )
    }
  ),
  
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148008?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:33:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8106ff60-e579-4992-ad1e-b18551047aa0</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;Thanks, here it goes:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have a tab interface where an index controls which content should be displayed. The content for each tab is stored in an array, and I need to show the content that matches the current index.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148007?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:30:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cd77865e-9890-48ff-aec6-1062df1ab1be</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;It works with anything you want.&amp;nbsp; I&amp;#39;d be happy to help you through a realistic example if you want, but you&amp;#39;ll need to provide some sample code / sample data / screenshots / etc, just something more than a vague description.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148006?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:28:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:93463af4-2cd4-4b18-b28d-3d6f51b73c59</guid><dc:creator>Silas. B. Ferreira</dc:creator><description>&lt;p&gt;does it work with an array of values? I don&amp;#39;t think so&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: choose function usage with rule inputs as parameters.</title><link>https://community.appian.com/thread/148005?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 14:27:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9a80a4c2-8877-44b8-ae82-6ad2f727e929</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Don&amp;#39;t use choose() at all now.&amp;nbsp; For anything.&amp;nbsp; We have &lt;a href="https://docs.appian.com/suite/help/25.1/fnc_logical_match.html"&gt;a!match()&lt;/a&gt; now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>