<?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>Comparing two arrays</title><link>https://community.appian.com/discussions/f/new-to-appian/31083/comparing-two-arrays</link><description>Hi, 
 
 Is there any straightforward method to compare below two arrays in such a way that, SelectedAnswersArray[1]=correctAnswersArray[1] , SelectedAnswersArray[2]=correctAnswersArray[2] and SelectedAnswersArray[3]=correctAnswersArray[3] . 
 SelectedAnswersArray</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/124014?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 06:47:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3227064e-dbdf-4223-8902-4324fea60241</guid><dc:creator>Rithani Vivekananthan</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a href="/members/chithrav2030"&gt;Chithra Venkitachalam &lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;You can try this as well.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!arr1:{1,2,4},
  local!arr2:{1,2,3},
  a!forEach(
    items: local!arr1,
    expression:fv!item=local!arr2[fv!index]
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1704955636055v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/124009?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 23:43:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02f40f4a-9e45-47fe-b65c-26862038051a</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Comparing two arrays returns a list of booleans. This might be a little better:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!array1: { 1, 2, 3 },
  local!array2: { 1, 2, 3 },
  not(contains(local!array1 = local!array2, false))
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/124008?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 19:31:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:19a8fce2-54c6-4969-9015-9bb7f6a7528f</guid><dc:creator>mathurambika0708</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi, &lt;br /&gt;Adding to Harshit&amp;#39;s and Stefan&amp;#39;s comments, you can also use Appian&amp;#39;s OOTB function &amp;#39;exact&amp;#39;, which will help you, in case you need to compare in a case-sensitive manner.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
  items: merge({ &amp;quot;a&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot; }, { &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;C&amp;quot; }),
  expression: exact(fv!item[1], fv!item[2])
)&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/124000?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 16:44:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:12659297-6423-4a09-8e5a-23721a580e42</guid><dc:creator>Chithra Venkitachalam </dc:creator><description>&lt;p&gt;oh great... Will try this approach also...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/123998?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 16:24:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1324cbca-8ae6-4ffb-8f15-cbbebda653ea</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Sure, but why would you want to do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/123997?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 16:23:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c806f14d-9eb4-468b-91ac-0b7b46deca5e</guid><dc:creator>Chithra Venkitachalam </dc:creator><description>&lt;p&gt;Can we use foreach() inside a foreach() ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/123996?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 16:21:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d190c164-defd-4a2c-8ea3-dc960ea4b7c1</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{&amp;quot;a&amp;quot;,&amp;quot;c&amp;quot;,&amp;quot;b&amp;quot;}={&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As unreal as it looks, just an equal operator will work.&amp;nbsp;&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/62/pastedimage1704903686354v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Comparing two arrays</title><link>https://community.appian.com/thread/123995?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 16:15:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2ef4857-d1e5-4ac7-9f2b-fa209add13fe</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Did you try a simple foreach() that compares the values on both lists by index? This will get you a list of booleans.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>