<?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>Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/discussions/f/rules/34011/passing-dynamical-no-of-parameters-to-a-rule</link><description>Hi, I have a below rule with pre-passed 3 parameters. Now, Is there any way that I can store these parameters (para1, para2, para3) and its values (val1, val2, val3) in variables and pass them to the rule dynamically? The no of parameter will be changed</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/thread/129303?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 16:42:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0b0b6307-8358-4cf5-83e5-3a05d52f4ca8</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Cool, thanks for confirming &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/thread/129302?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 16:39:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ea90fbf-4266-4794-9490-166a84dd4974</guid><dc:creator>jagjots3791</dc:creator><description>&lt;p&gt;Thank you. Thats what I wanted to know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/thread/129301?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 16:27:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1a9fbacc-3f05-41e4-a9f3-de6ed8bf8238</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;No, that is not possible.&amp;nbsp; The best thing you can do (and honestly, I&amp;#39;ve found it to be sufficient in nearly 100% of my use cases over the past 11+ years) is to call all parameters and conditionally pass values to them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/thread/129299?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 16:23:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8b4c0c47-a607-4747-ae45-f72c83b2f7fe</guid><dc:creator>jagjots3791</dc:creator><description>&lt;p&gt;Yeah, I want to pass parameters like below in the rule thats not hardcoded and it should give what I written in expression original question. I guess its not possible.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!para: {&amp;quot;para1&amp;quot;, &amp;quot;para2&amp;quot;},
  local!val: {&amp;quot;val1&amp;quot;, &amp;quot;val2&amp;quot;},
  rule!JS_abcRule(
    local!para[1]: local!val[1],
    local!para[2]: local!val[2]
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/thread/129296?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 15:54:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e1583671-03a7-4985-be8f-b21560730fac</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;When you call a rule with Keyword Syntax (like you&amp;#39;ve done in your example), all parameters are optional as long as you&amp;#39;ve set up the rule to handle nulls.&amp;nbsp; From the calling rule or interface, you can invoke any subset (between 1 and all) of the parameters (it can&amp;#39;t be zero unless the rule has none), and each one you utilize can conditionally be passed a value or not, depending on the logic you prefer.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s not really any additional way to &amp;quot;dynamically pass parameters&amp;quot;, if i&amp;#39;m even reading your question right, because in any one invocation of the rule, any parameters you pass in must be hardcoded into the rule call (but this is where you can fall back on conditionally passing in a value for individual items if you wish).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/thread/129295?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 15:37:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c08cf8cd-e8ce-46ac-a3e4-4837579abf3e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Did you consider to use a list or a map?&lt;/p&gt;
&lt;p&gt;What are you aiming for? Appian is not Java, trying add more levels of abstraction gets you quickly into unsafe waters.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing dynamical no of parameters to a rule</title><link>https://community.appian.com/thread/129294?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 15:36:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b371f6c8-d995-4875-b995-8bc2a73f1dd3</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a href="/members/jagjots3791"&gt;jagjots3791&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Not sure uf i completely understand your question. But from what I understand, you want to use a set of values even if the user/process doesn&amp;rsquo;t provide values to them.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;you can have the values set in locals and use default value function.&lt;/p&gt;
&lt;p&gt;If your question is about query filter or rule parameters you can handle it with the apply when or simple if logics.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>