<?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>Read CSV file and want to find duplicate value</title><link>https://community.appian.com/discussions/f/general/34858/read-csv-file-and-want-to-find-duplicate-value</link><description>Hi 
 I need advice. 
 Read CSV file and want to find duplicate value. 
 if there are duplicate values .I want to display error msg.. 
 I was able to load the CSV and remap it to the map list, but I was unable to check for duplicates values and unable</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134629?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:52:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84d4bf68-b1e8-43a1-b1bf-cf9eccb9f56d</guid><dc:creator>spykid</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for taking the time to explain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134628?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:43:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:35d6a5b5-0aa6-43ad-a9ed-717c4f6da3f9</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;From what I understand, you are trying to create a validation.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
   contains(
     local!duplicateCheck.error,
     &amp;quot;Duplicate Values Found&amp;quot;
   ),
   &amp;quot;This file contains one or more duplicate values.&amp;quot;,
   &amp;quot;&amp;quot;
 )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the code provided before replace the local variable used for getting the output with this.&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/11/pastedimage1714668223920v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134626?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:25:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:42eb9555-4d33-42b0-8e86-7f6c944c49c2</guid><dc:creator>spykid</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If my result have a error msg i need to create a csv file with error msg&amp;nbsp; .&lt;/p&gt;
&lt;p&gt;This error msg csv file will show in interface&amp;nbsp; and then user can download the link of that csv file .&lt;/p&gt;
&lt;p&gt;If&amp;nbsp; my result have not&amp;nbsp; error msg i will register that csv file result&amp;nbsp; to DB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134625?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:19:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2e265d4c-9c40-4b54-903c-6e997a567979</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Where are you planning to use this output error exactly would be my first question. That would help get a better answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134624?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:19:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ef72fc56-b37b-4330-afdc-3889973d4471</guid><dc:creator>spykid</dc:creator><description>&lt;p&gt;yes.I made it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134623?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:18:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:79aa6f31-f5af-4637-9e6c-5e7260f2667d</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;If the answer works please do verify the answers which helped you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134622?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:18:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:adb7e9b2-181b-4e3c-bcd2-576cdc605977</guid><dc:creator>spykid</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have another question, I would like to create a CSV file with the current results.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;How can i get it more efficiently.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134621?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 16:16:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4bd6b85f-82c1-4c3c-ba45-1eaa985be42f</guid><dc:creator>spykid</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Really helpful for me. I understand and work for me!!!&lt;/p&gt;
&lt;p&gt;Thank you so much for your help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134620?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 15:42:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2377007a-894d-4542-bf4f-8d343b51b69a</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Please find the below code. Made a sample code for your understanding. More efficient and simpler code can be created.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!doc: ri!doc,
  local!data: readexcelsheetpaging(
    excelDocument: ri!doc,
    sheetNumber: 0,
    pagingInfo: a!pagingInfo(startIndex: 2, batchSize: 5000)
  ).data.values,
  local!formatData: a!forEach(
    items: local!data,
    expression: if(
      a!isNullOrEmpty(fv!item[2]),
      {},
      a!map(
        name: fv!item[2],
        gender: fv!item[3],
        department: fv!item[4],
        tech: fv!item[5]
  )
  )
  ),
  local!duplicateCheck: a!forEach(
    items: local!formatData,
    expression: a!update(
      data: fv!item,
      index: &amp;quot;error&amp;quot;,
      value: if(
        length(
          wherecontains(
            fv!item.name,
            local!formatData.name
          )
        )&amp;gt;1,
        &amp;quot;Duplicate Values Found&amp;quot;,
        &amp;quot;&amp;quot;
      )
    )
  ),
  local!duplicateCheck
)&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/11/pastedimage1714664418301v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134617?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 14:10:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:158f17fa-7fe5-40fe-91f5-cf1ce597ef78</guid><dc:creator>spykid</dc:creator><description>&lt;p&gt;&lt;a href="/members/daniell"&gt;Dan Lluhi&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At first i want to read csv file and then check csv file data. I&amp;#39;m looking for duplicate value on [No] column.&lt;/p&gt;
&lt;p&gt;if there are duplicate value on [No] column. i want to add error msg and sent it back csv file with error message.&lt;/p&gt;
&lt;p&gt;If there&amp;nbsp; are no duplicate value register to DB.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read CSV file and want to find duplicate value</title><link>https://community.appian.com/thread/134616?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 14:01:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0c49fd26-e062-42cb-9715-6bf0e3507cbb</guid><dc:creator>Dan Lluhi</dc:creator><description>&lt;p&gt;Could you elaborate more on what you are trying to do? Are you looking for duplicates on &amp;quot;No&amp;quot; and/or &amp;quot;col1&amp;quot; and/or &amp;quot;col2&amp;quot;? What are you expecting in error1/2/3? What does your current expression rule look like, and what have you tried for finding the duplicate values that is giving you difficulty?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>