<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: IRPA - count unique values in array in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/irpa-count-unique-values-in-array/qaa-p/14103374#M4914256</link>
    <description>&lt;P&gt;ah, just found that devil in the detail - output has to be set in format like below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="liskaj01_0-1747390233611.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/262048i0A4061D0B4D1E77D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="liskaj01_0-1747390233611.png" alt="liskaj01_0-1747390233611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then it works in the script above. However I am still curious if this can be made easier? for stepX.returnedValues I see also function like "CountUniqueArray" however it also gives no result like {}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 May 2025 10:15:15 GMT</pubDate>
    <dc:creator>liskaj01</dc:creator>
    <dc:date>2025-05-16T10:15:15Z</dc:date>
    <item>
      <title>IRPA - count unique values in array</title>
      <link>https://community.sap.com/t5/technology-q-a/irpa-count-unique-values-in-array/qaq-p/14103368</link>
      <description>&lt;P&gt;Hi, I am using activity get values (cells). This gives list of values. Using this variable and embedding it with ".length" it gives number of values. But how to count unique values? IRPA suggest things like ".count" or ".unique" but it gives empty result. I have also tried to use custom script like this one:&lt;/P&gt;&lt;P&gt;const arr = RunID;&lt;BR /&gt;function countUniqueArray(arr) {&lt;BR /&gt;const Result = [];&lt;BR /&gt;arr.forEach(item =&amp;gt; {&lt;BR /&gt;if (!Result.includes(item)) {&lt;BR /&gt;Result.push(item);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;return Result.length;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return(countUniqueArray(arr));&lt;/P&gt;&lt;P&gt;But issue is:&lt;/P&gt;&lt;P&gt;1) when RunID (returned values from excel) are passed directly, counting of unique values does not work and gives only total number of items correctly, but not unique values&lt;/P&gt;&lt;P&gt;2) when insted of RunID I hard code something like&amp;nbsp;["apple", "banana", "apple", "orange"] it works correctly and returns 3&lt;/P&gt;&lt;P&gt;So either change input to something like in 2) (but how) or use some javascript function directly in one of the steps.&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 09:57:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/irpa-count-unique-values-in-array/qaq-p/14103368</guid>
      <dc:creator>liskaj01</dc:creator>
      <dc:date>2025-05-16T09:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: IRPA - count unique values in array</title>
      <link>https://community.sap.com/t5/technology-q-a/irpa-count-unique-values-in-array/qaa-p/14103374#M4914256</link>
      <description>&lt;P&gt;ah, just found that devil in the detail - output has to be set in format like below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="liskaj01_0-1747390233611.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/262048i0A4061D0B4D1E77D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="liskaj01_0-1747390233611.png" alt="liskaj01_0-1747390233611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then it works in the script above. However I am still curious if this can be made easier? for stepX.returnedValues I see also function like "CountUniqueArray" however it also gives no result like {}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 10:15:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/irpa-count-unique-values-in-array/qaa-p/14103374#M4914256</guid>
      <dc:creator>liskaj01</dc:creator>
      <dc:date>2025-05-16T10:15:15Z</dc:date>
    </item>
  </channel>
</rss>

