<?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>Indexing to Lis of text String</title><link>https://community.appian.com/discussions/f/general/25291/indexing-to-lis-of-text-string</link><description>Hi All, 
 I am trying to use indexing for type &amp;quot; List of Text String &amp;quot; but the output i am getting not the expected output i am adding the screenshots here for reference. 
 
 Thanks In advance, 
 SSP</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98680?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 05:55:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cac34ce3-f51a-431b-89a7-d195a0872a8c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This seems like that this is a list of lists where each sub-list contains one text. Then trying to index the first item will basically return the first character of each text. a!flatten() is made to solve this kind of issue. Then your approach will work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98677?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 05:51:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d99d471-9240-4820-a7ae-86638e0c9f17</guid><dc:creator>venkyuppala09</dc:creator><description>&lt;p&gt;Yes your correct but it won&amp;#39;t work when you reading the data from Excel as the data type is like (list of list of.. variants), try to get the values using different index and take separate local variables for each index output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98673?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 05:41:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7d5d22a6-ec95-4cbc-9c16-2bea5e2788b3</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!uploadedFile,
  local!exceldata,
  a!sectionLayout(
    contents: {
      a!textField(
        value:local!uploadedFile,
        saveInto: {
          local!uploadedFile,
          a!save(
            local!exceldata,
            index(
              readexcelsheet(
                excelDocument:todocument(57745), /*57745 is the document id. Please replace it with yours*/
                sheetNumber:0,
                startRow: 0
              ),
              &amp;quot;result&amp;quot;,
              {}
            )
          )
        }
      ),
      a!gridField(
        label: &amp;quot;Excel Data :&amp;quot;,
        emptyGridMessage: &amp;quot;Please Upload a File with Values&amp;quot;,
        data: remove(local!exceldata, 1),
        columns: a!forEach(
          items: local!excelData[1].values,
            expression: a!gridColumn(label: fv!item, value: index(fv!row.values,fv!index,{}))
        ),
        showWhen: not(a!isNullOrEmpty(local!uploadedFile))
      )

    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please refer the above code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98672?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 05:39:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6d1d020b-ceae-4685-8157-4f56d07a6f94</guid><dc:creator>sivasuryap0002</dc:creator><description>&lt;p&gt;Thank you will check that&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98671?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 05:38:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:31fb69a0-5008-4656-870e-15c964e6dd00</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;It is returning blank because the file is not in Appian System. you are just uploading it and the uploaded file will be in Appian system once you click on submit&amp;nbsp;button. Make Sure, the interface where you are uploading the file is either a start form of the process model or a user input task.&lt;/p&gt;
&lt;p&gt;Just to check the code, you can manually upload the excel into Appian and copy the id of that document and put it into excelDocument configuration of the ReadExcelSheet function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98670?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 05:25:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2d01740-75e8-4ea8-8ef7-4e2fbe15c635</guid><dc:creator>sivasuryap0002</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!exceldata,
  a!sectionLayout(
    contents: {
      a!fileUploadField(
        label: &amp;quot;Upload a File :&amp;quot;,
        target: cons!IT_FOLDER,
        fileNames: &amp;quot;File Reading-File Uploaded on &amp;quot; &amp;amp; text(now(), &amp;quot;ddmmyyhhmmss&amp;quot;),
        fileDescriptions: &amp;quot;File Reading Interface Testing on File Uploaded on &amp;quot; &amp;amp; text(now(), &amp;quot;ddmmyyhhmmss&amp;quot;),
        maxSelections: 1,
        value: ri!uploadedFile,
        saveInto: {
          ri!uploadedFile,
          a!save(
            local!exceldata,
            index(
              readexcelsheet(
                excelDocument:todocument(ri!uploadedFile),
                sheetNumber:0,
                startRow: 0
              ),
              &amp;quot;result&amp;quot;,
              {}
            )
          )
        },
        required: true(),
        validations: if(
          contains({ &amp;quot;csv&amp;quot;, &amp;quot;xlsx&amp;quot; }, fv!files.extension),
          {},
          &amp;quot;Only CSV,XLSX formats files should be uploaded but uploaded file is of format .&amp;quot; &amp;amp; fv!files.extension
        )
      ),
      a!gridField(
      label: &amp;quot;Excel Data :&amp;quot;,
      emptyGridMessage: &amp;quot;Please Upload a File with Values&amp;quot;,
      data: remove(local!exceldata, 1),
      columns: a!forEach(
      items: local!excelData[1].values,
      expression: a!gridColumn(label: fv!item, value: index(fv!row,fv!index,{}))
      ),
      showWhen: not(a!isNullOrEmpty(ri!uploadedFile))
      )
      
    }
  )
)&lt;/pre&gt;&lt;br /&gt;I have tried that but in the save into, I don&amp;#39;t know why? but the readexcelsheet function is not working.&lt;br /&gt;Should we not use readexcelsheet in saveinto ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98603?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:57:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:34cb776b-a2a0-4973-a8f7-f0911a4dd83a</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!excelData: index(readexcelimportfile(
    excelDocument: todocument(57745), /*put excel document id instead of 57745*/
    sheetNumber:0,
    startRow:0
  ),&amp;quot;result&amp;quot;,{}),
  a!gridField(
    data: remove(local!excelData,1),
    columns: {
      a!forEach(
        items: local!excelData[1].values,
        expression: a!gridColumn(
          label: fv!item,
          value: index(fv!row.values,fv!index,{})
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please refer this code and see if it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98599?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:49:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f865c491-bbcb-4c13-9f9a-684b764f777a</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;Oh you want to create a grid based on dynamic Excel. Let me write the code and will let you know ASAP.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98598?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:48:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7e21685d-56d7-4990-89cd-5c45c7e5e9c2</guid><dc:creator>sivasuryap0002</dc:creator><description>&lt;p&gt;I am trying to create a dynamic excel reader and use the data in a grid.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98597?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:46:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7f23ac1f-b737-4a47-a03e-cd662dcc0c3f</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;IN the code you provided, you are using some excel file. What you want to get from that and what is there in that file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98596?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:43:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:41b28d09-d2d5-4ab7-a7c6-b7f011eebad0</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;a!localVariables(&lt;br /&gt; local!text:{&amp;quot;How&amp;quot;,&amp;quot;Are&amp;quot;,&amp;quot;You&amp;quot;},&lt;br /&gt; index(local!text,2,{})&lt;br /&gt;)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It will work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98595?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:40:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:24a93344-59bd-4e4c-a099-f7188596daed</guid><dc:creator>sivasuryap0002</dc:creator><description>&lt;p&gt;The input is like : &amp;quot;How&amp;quot;,&amp;quot;Are&amp;quot;,&amp;quot;You&amp;quot; (which is of type list of&amp;nbsp; text strings),&lt;br /&gt;I am trying to get only 1 at a time using indexing (either &amp;quot;How&amp;quot; or &amp;quot;Are&amp;quot; or &amp;quot;You&amp;quot;), But I am getting the &amp;quot;H&amp;quot;,&amp;quot;A&amp;quot;,&amp;quot;R&amp;quot; if i am using index 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98594?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:36:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d9818de1-e119-4ef8-a8cd-ab1247b3189f</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;What is the input and what output you are expecting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98593?ContentTypeID=1</link><pubDate>Thu, 28 Jul 2022 06:32:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3239fa8c-d259-4f58-a585-b721abbe331c</guid><dc:creator>sivasuryap0002</dc:creator><description>&lt;p&gt;Could you please help me in with the issue I am facing ?&lt;br /&gt;&amp;quot;&lt;span&gt;I am trying to use indexing for type &amp;quot;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_non_value"&gt;List of Text String&amp;nbsp;&amp;quot; but the output i am getting not the expected output&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98289?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 06:33:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c8bedd28-8e24-49ae-8fd1-6fb55b2e22aa</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Sorry, but again, while this behaviour works most of the times, it is no documented and has edge cases in which it does not work and is super difficult to debug.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98285?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 05:53:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:57bd3a92-016a-4f3e-b0d6-a47bcee9d565</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Try using the a!flatten() function to remove this multiple levels of lists and then it should be easier.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98284?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 05:35:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fa259c85-758f-4769-b3bb-c3c2be272221</guid><dc:creator>sivasuryap0002</dc:creator><description>&lt;p&gt;index(local!exceldata, &amp;quot;result&amp;quot;, &amp;quot;values&amp;quot;, 1, {}) is equivalent to&lt;br /&gt;&lt;span&gt;index(index(index(local!exceldata, &amp;quot;result&amp;quot;,{}),&amp;quot;values&amp;quot;,{}),1,{})&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98276?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 03:43:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8ea1ff05-ec24-43b9-8246-530d486c146b</guid><dc:creator>deepakg681722</dc:creator><description>&lt;p&gt;Could you please put some light on the&amp;nbsp;functionality what you are trying to achieve. What is the output you are getting and what you are expecting for the same?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98266?ContentTypeID=1</link><pubDate>Sat, 23 Jul 2022 15:41:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4ce32543-6f7a-4413-a0aa-d4c448823a97</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This is confusing. Why do you use more than three parameters with the index function? The behaviour with more than three parameters is undefined.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98265?ContentTypeID=1</link><pubDate>Sat, 23 Jul 2022 15:02:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a4c593ca-22c0-4fe0-b71d-b14a6ea0f0fc</guid><dc:creator>sivasuryap0002</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;br /&gt;Here is my code.&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!exceldata: readexcelsheet(
    excelDocument: cons!IT_SAMPLE_FILE,
    sheetNumber: 0,
    startRow: 0,
    /*stopReadingAtFirstBlankRow: false(),*/
    /*pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 0)*/
    
  ),
  local!datalength: length(
    index(local!exceldata, &amp;quot;result&amp;quot;, &amp;quot;values&amp;quot;, {})
  ),
  local!headers: index(local!exceldata, &amp;quot;result&amp;quot;, &amp;quot;values&amp;quot;, 1, {}),
  local!filecdt: a!forEach(
    items: local!headers[1],
    expression: {
      fv!item &amp;amp; &amp;quot; : &amp;quot; &amp;amp; a!forEach(
        items: 2,
        /*enumerate(local!datalength - 1) + 2,*/
        expression: a!forEach(
          items: index(
            local!exceldata,
            &amp;quot;result&amp;quot;,
            &amp;quot;values&amp;quot;,
            fv!item,
            {}
          ),
          expression: a!forEach(
            items: fv!item,
            expression: a!forEach(
              items: fv!item,
              expression: fv!item
            )
          )
        )
      )
    }
  ),
  local!filecdt
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Indexing to Lis of text String</title><link>https://community.appian.com/thread/98264?ContentTypeID=1</link><pubDate>Sat, 23 Jul 2022 14:59:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8e6f5e4f-5fc5-463c-8da6-d6f13161734e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Can you share your code? I am sure I understand what you do and what your goal is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>