<?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>issue on file upload component and grid</title><link>https://community.appian.com/discussions/f/new-to-appian/38716/issue-on-file-upload-component-and-grid</link><description>I am currently working on a file upload component and do not require any process model for my use case. I have successfully uploaded an Excel file containing data for five users. To read this data, I have written an expression rule, which is functioning</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: issue on file upload component and grid</title><link>https://community.appian.com/thread/146312?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 00:12:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:902463cc-ccb5-4711-ad4c-e1ee870bc9d6</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Here is a working example:&lt;/p&gt;
&lt;p&gt;1. To be able to access the files, you need to submit the form if you are in a start or task form. Otherwise, you&amp;nbsp;can&amp;nbsp;use submitUploadedFiles as I have demonstrated.&lt;/p&gt;
&lt;p&gt;2. You&amp;#39;ll need the&amp;nbsp;&lt;a href="https://community.appian.com/b/appmarket/posts/text-file-reader"&gt;Text File Utilities&lt;/a&gt;&amp;nbsp;plugin to have access to the &lt;strong&gt;readtextfromfile&lt;/strong&gt; function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!userData,
  local!csvFile,
  local!csvData,
  a!formLayout(
    label: &amp;quot;&amp;quot;,
    contents: {
      a!sectionLayout(
        label: &amp;quot;Create Users in Bulk&amp;quot;,
        contents: {
          a!linkField(
            instructions: &amp;quot;Add additional rows with user information based on the header&amp;quot;,
            links: {
              a!documentDownloadLink(
                label: &amp;quot;CSV Template&amp;quot;,
                document: cons!S_DRUG_PRODUCTS
              )
            }
          ),
          a!fileUploadField(
            label: &amp;quot;User List&amp;quot;,
            labelPosition: &amp;quot;ABOVE&amp;quot;,
            target: cons!S_FOLDER_UPLOAD,
            maxSelections: 1,
            value: ri!excelDocument,
            saveInto: {
              ri!excelDocument,
              if(
                a!isNotNullOrEmpty(ri!excelDocument),
                a!submitUploadedFiles(
                  documents: ri!excelDocument,
                  onSuccess: {
                    a!save(
                      local!csvFile,
                      readtextfromfile(ri!excelDocument, true)
                    ),
                    a!save(
                      local!csvData,
                      a!localVariables(
                        local!csvLines: split(local!csvFile, char(10)),
                        /* Splitting by newline */
                        a!forEach(
                          items: local!csvLines,
                          expression: a!localVariables(
                            local!items: split(fv!item, &amp;quot;,&amp;quot;),
                            if(
                              fv!index=1,
                              {}, /* Skip first line */
                              /* Splitting by comma */
                              a!map(
                                username: local!items[1],
                                firstName: local!items[2],
                                lastName: local!items[3],
                                email: local!items[4]
                              )
                            )
                          )
                        )
                      )
                    )
                  }
                ),
                {}
              )
            },
            required: true
          )
        }
      ),
      a!gridField(
        data: todatasubset(local!csvData).data,
        columns: {
          a!gridColumn(
            label: &amp;quot;Username&amp;quot;,
            sortField: &amp;quot;username&amp;quot;,
            value: fv!row.username
          ),
          a!gridColumn(
            label: &amp;quot;First Name&amp;quot;,
            sortField: &amp;quot;firstName&amp;quot;,
            value: fv!row.firstName
          ),
          a!gridColumn(
            label: &amp;quot;Last Name&amp;quot;,
            sortField: &amp;quot;lastName&amp;quot;,
            value: fv!row.lastName
          ),
          a!gridColumn(
            label: &amp;quot;Email&amp;quot;,
            sortField: &amp;quot;email&amp;quot;,
            value: fv!row.email
          )
        }
      )
    },
    buttons: a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: &amp;quot;Submit&amp;quot;,
          value: false,
          saveInto: ri!cancel,
          submit: true,
          style: &amp;quot;SOLID&amp;quot;,
          loadingIndicator: true
        )
      },
      secondaryButtons: {
        a!buttonWidget(
          label: &amp;quot;Cancel&amp;quot;,
          value: true,
          saveInto: { ri!cancel },
          submit: true,
          style: &amp;quot;OUTLINE&amp;quot;,
          validate: false
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: issue on file upload component and grid</title><link>https://community.appian.com/thread/146311?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 00:07:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6674b9f5-3fdf-4fb1-9758-d7bb114ad756</guid><dc:creator>osanchea</dc:creator><description>&lt;p&gt;Hi.&amp;nbsp;The formLayout() component is a top-level component, meaning you can&amp;#39;t have multiple components at the same level. To prevent your interface from throwing an error, you can place your &amp;quot;rule!TAP_upload&amp;quot; interface inside the &amp;quot;contents&amp;quot; parameter of formLayout(). Refer the example below:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!formLayout(
  label: &amp;quot;Form&amp;quot;,
  contents: {
    a!sectionLayout(
      label: &amp;quot;Section&amp;quot;,
      contents: {}
    ),
    rule!TAP_upload(
      userdata: ri!excelDocument,
      showwhen: ri!cancel = true()
    )
  },
  buttons: a!buttonLayout(
    primaryButtons: {
      a!buttonWidget(
        label: &amp;quot;Submit&amp;quot;,
        submit: true,
        style: &amp;quot;SOLID&amp;quot;,
        loadingIndicator: true
      )
    },
    secondaryButtons: {
      a!buttonWidget(
        label: &amp;quot;Cancel&amp;quot;,
        value: true,
        saveInto: {},
        submit: true,
        style: &amp;quot;OUTLINE&amp;quot;,
        validate: false
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>