<?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>how to pass array in expression rule</title><link>https://community.appian.com/discussions/f/rules/35062/how-to-pass-array-in-expression-rule</link><description>I I want the result of this expression rule to be in the below format or the highlighted format in the editor. currently I am passing name and comment from one CDT ,now along with this 2 fields I need to pass the colleagues array with add array with in</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135952?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 13:40:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:06a0d321-e68e-4933-b3e5-1c050ddcb14a</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="91720" url="~/discussions/f/rules/35062/how-to-pass-array-in-expression-rule/135855"]Instead&amp;nbsp; of [ ] , I need&amp;nbsp; { } [/quote]
&lt;p&gt;The [ ] here are because the structure of your code indicates that the &amp;quot;CAC&amp;quot; property will contain an array, since you use curly brackets and then a!map().&amp;nbsp; If it&amp;#39;s just supposed to contain a single sub-dictionary then you don&amp;#39;t need to double-indicate this - meaning you could just pass in an a!map() call, OR the curly brackets - when you use both, it assumes that the property contains an array of (one of) that map.&lt;/p&gt;
&lt;p&gt;This is what I get when I comment out just one of those:&lt;br /&gt;&lt;img style="max-height:114px;max-width:354px;" height="114" src="/resized-image/__size/708x228/__key/communityserver-discussions-components-files/15/pastedimage1716903618790v1.png" width="354" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135855?ContentTypeID=1</link><pubDate>Sun, 26 May 2024 19:26:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8701c946-5a0c-48e2-836c-4036495b0f9f</guid><dc:creator>ZAINAB</dc:creator><description>&lt;p&gt;a!toJson(&lt;br /&gt; {&lt;br /&gt; name: &amp;quot;NAME&amp;quot;,&lt;br /&gt;Comment: &amp;quot;comments&amp;quot;,&lt;br /&gt;CAC: {&lt;br /&gt; a!map(&lt;br /&gt;TypeId: 1,&lt;br /&gt; addcolleague: a!map(&lt;br /&gt; email: &amp;quot;requestorEmail&amp;quot;, &lt;br /&gt; displayname:&amp;quot;requestorName&amp;quot;, &lt;br /&gt; &lt;br /&gt; deletedFlag: false, &lt;br /&gt; identityProviderID: 2, &lt;br /&gt; idFromProvider:&amp;quot;Value&amp;quot;&lt;/p&gt;
&lt;p&gt;)&lt;br /&gt; &lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m getting output as&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;{&amp;quot;name&amp;quot;:&amp;quot;NAME&amp;quot;,&lt;br /&gt;&amp;nbsp; Comment&amp;quot;:&amp;quot;comments&amp;quot;,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;CAC:&lt;br /&gt;&lt;span style="font-size:150%;"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;{&amp;quot;TypeId&amp;quot;:1,&lt;br /&gt;&amp;quot;addcolleague&amp;quot;:{&amp;quot;email&amp;quot;:&amp;quot;requestorEmail&amp;quot;,&lt;br /&gt;&amp;quot;displayname&amp;quot;:&amp;quot;requestorName&amp;quot;,&lt;br /&gt;deletedFlag&amp;quot;:false,&lt;br /&gt;&amp;quot;identityProviderID&amp;quot;:2,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;idFromProvider&amp;quot;:&amp;quot;sagdoi&amp;quot;&lt;br /&gt;&lt;br /&gt;}}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:200%;"&gt;&lt;strong&gt;&lt;span style="color:#800080;"&gt;]&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;}&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp;:Instead&amp;nbsp; of [ ] , I need&amp;nbsp; { } ,can you please help ,rest everything is expected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m passing this expressinrule output as an input to integration ,it says [ ] is invalid. can you please help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135826?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 14:10:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df73edb8-1a8d-42bf-8df2-56dea58eede5</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I don&amp;#39;t recommend ever using nested CDTs, personally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135825?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 14:08:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d0354dd3-c6c4-4306-b010-d1a4655360fe</guid><dc:creator>ZAINAB</dc:creator><description>&lt;p&gt;&lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp; : &lt;br /&gt;&lt;br /&gt;I have one table in DB and created a CDT created from the same&amp;nbsp; . In the CDT I want to add a nested CDT , will it impact&amp;nbsp; db of that table if I add nested cdt in the CDT?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135824?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 13:56:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:43316261-b1a6-426e-b582-ba179a7548b5</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;(and of course that entire thing can just be wrapped in a!toJson once you know it&amp;#39;s working...)&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/pastedimage1716559002615v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135823?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 13:55:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1facad6a-001f-4496-a809-028551fda10f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The info you&amp;#39;re providing is all super unclear.&amp;nbsp; Please show us:&lt;/p&gt;
&lt;p&gt;1) a screenshot of your actual incoming data (making sure we can understand where a CDT is an array of values or not)&lt;br /&gt;2) a screenshot of your actual currently-configured expression rule, which you&amp;#39;re trying to run and it isn&amp;#39;t working&lt;/p&gt;
&lt;p&gt;Just double checking here but do you know how to use a!forEach()?&amp;nbsp; From the context of the code in your original post expression rule screenshot, it looks like you might not.&amp;nbsp; I don&amp;#39;t see a single reference to &amp;quot;fv!item&amp;quot; though, so it&amp;#39;s making me prety doubtful.&lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!map(
  name: &amp;quot;some string from DB&amp;quot;,
  comment: &amp;quot;some comment&amp;quot;,
  
  translatedInputs: a!forEach(
    ri!testInput,
    a!map(
      email: fv!item.inputEmail,
      dName: fv!item.name,
      eFlag: false(),
      isActive: fv!item.activeFlag
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/pastedimage1716558924274v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135798?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 07:19:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:07831035-76a0-45f2-a605-8672b4033dec</guid><dc:creator>ZAINAB</dc:creator><description>&lt;p&gt;I want this body as input to an integration .In the existing process model we are passing body only with name and comment as an input to an integration via scriptask (input as expressionrule )&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I need to get output of expressionrule as below&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"&gt;a!toJson&lt;br /&gt;({&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;name&amp;quot;: &amp;quot; some string from db &amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Comment&amp;quot;: &amp;quot;some string from db&amp;quot;,&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CAC:{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;TypeId&amp;quot;:&amp;nbsp; 1,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*Value is always 1*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; add: {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;email&amp;quot;:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;some string from data &amp;quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;dName&amp;quot; :&amp;nbsp; &amp;quot;some string from data&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;Provider&amp;quot;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; :&amp;nbsp; &amp;quot;some string from data&amp;quot;,&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;eFlag&amp;quot;: false,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;dFlag&amp;quot;: false,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;ID&amp;quot;: 2&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;})&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;name ,comment,email,provider and dname values are present in one CDT&amp;nbsp; . I&amp;#39;m trying build an array structure and get email and dname&amp;nbsp; from main CDT where existing values are present.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Have already existing CDT I..e Main CDT ---name ,comment,email,dname and few other fields and now i have added CAC Cdt in this mail CDT as an array&lt;br /&gt;&lt;br /&gt;2. Created One CDT for CAC with fields type ID and add CDT&lt;br /&gt;&lt;br /&gt;3. In ADD CDT , added fields email,name,provider,eflag ,dflag&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Can you please help because of incorrect looping server got crashes due to memoryheap&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135794?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 05:28:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4e457fbc-7ff6-4d33-a7f5-7589d928bd8c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Is the code you shared your actual code? This will hardly work.&lt;/p&gt;
&lt;p&gt;In line 3, why do you wrap ri!name in quotes?&lt;/p&gt;
&lt;p&gt;In line 7, why do you wrap the field name in quotes?&lt;/p&gt;
&lt;p&gt;In line 13, what is &amp;quot;fvfv!ite!item.requestorname&amp;quot;?&lt;/p&gt;
&lt;p&gt;And I have the same question as &lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp;has. What is the input, and what is the intended output?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135793?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 18:53:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:294d1146-96ab-4f27-a218-3a4090dfbf41</guid><dc:creator>ZAINAB</dc:creator><description>&lt;p&gt;I have updated the above comment with required details&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135791?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 18:47:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:92b62e0a-8de1-4ee4-b6d8-a4ab14bcb174</guid><dc:creator>ZAINAB</dc:creator><description>&lt;p&gt;&lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp; :can you please look at this&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135790?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 18:45:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a218d1f2-2c8a-4c23-9b4d-e5f05c049d28</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;It&amp;#39;s still pretty unclear what your actual inputs will be and what your desired output is.&amp;nbsp; Could you perhaps simplify somewhat and re-try?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135789?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 18:37:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:152ea102-f2b4-4b2e-a2bb-29cd4b401133</guid><dc:creator>ZAINAB</dc:creator><description>&lt;p&gt;ok&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135768?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 14:27:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d994236-8682-4e20-ac81-817cbd0e5392</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;In your screenshot, &amp;quot;ri!add&amp;quot; is not configured as an array (list), despite that being specifically what Stefan advised.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/pastedimage1716474468310v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135758?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 12:14:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:661abe2d-7b0b-4793-9d4d-5b9cb9be56c0</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Dictionaries are lists of field-value pairs. In that line with the foreach, I am missing a field name.&lt;/p&gt;
&lt;p&gt;I would expect something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fieldName: a!forEach(&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135757?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 12:09:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb3cdb3d-1d74-4618-a708-29eaa62e386c</guid><dc:creator>ZAINAB</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/pastedimage1716466050752v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;No output is not in the expected format&amp;nbsp;&lt;br /&gt;&lt;br /&gt;name and comment i have those values&amp;nbsp; in1st CDT i.e TEST , I have displayname ,email,idprovider values also in 1st CDT but I need those values in array for addcolleague&lt;br /&gt;&lt;br /&gt;can you please help&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to pass array in expression rule</title><link>https://community.appian.com/thread/135753?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 11:23:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cd6e6db3-2549-4d89-9d1c-3b8d7cd3bffd</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You can add a rule input of that M_addcollegue type and make it a list.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>