<?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>Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/discussions/f/user-interface/38942/upload-attachments-interface-backed-by-action</link><description>Hello, 
 I have this interface where there is a grid that shows uploaded attachments and a button to refresh the grid whenever there is a new attachment uploaded. 
 I am running into an issue where if the user clicks on &amp;quot;Refresh existing attachments&amp;quot;</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147358?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 19:31:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c303bfbb-1053-4229-8481-65cf2ae29606</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;great, thanks for confirming/verifying &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147357?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 19:30:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6725bfd3-4312-4fc9-b8e0-20deb41eea22</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;It worked!! Youre the best. Thank you!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147353?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 18:20:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aab3de69-1a9c-433c-be48-905319637298</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I think your Expression Rule is the culprit.&amp;nbsp; Remember that Appian essentially flattens all levels of code (from parent and child forms as well as expression rules) when it runs, so a variable within an expression rule will (unintuitively) go stale even when the parent form is expected to refresh it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Refresh Variables are automatically set to &amp;quot;refresh on referenced variable change&amp;quot; as TRUE and all other refresh parameters as FALSE (or empty), so take that into account.&amp;nbsp; For now, please try setting local!search to a Refresh Variable with the &amp;quot;RECORD_ACTION&amp;quot; refreshAfter, like your on-form variables.&amp;nbsp; If that doesn&amp;#39;t work, I have an alternative trick that can force it to refresh, though it&amp;#39;s more involved and less simple, so try this way first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147352?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 18:15:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:16058f39-d077-495f-9efa-4ea06fa42baf</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!search: findcontentbyattribute(
    searchAllContent: false,
    contentType: &amp;quot;folder&amp;quot;,
    attributeName: &amp;quot;name&amp;quot;,
    /*    change folder prefix*/
    searchCriteria: cons!FRR_TXT_FOLDER_PREFIX &amp;amp; ri!requestId,
    rootFolder: cons!FRR_FOLDER_RECORD_ATTACHMENTS
  ),
  if(
    a!isNotNullOrEmpty(local!search),
    tofolder(split(local!search, &amp;quot;:&amp;quot;)[2]),
    null
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thats correct. It only automatically populates after the first attachment is in the grid&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147351?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 18:14:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:501395ce-ad23-4368-a9b3-46300ed40c3c</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="160049" url="~/discussions/f/user-interface/38942/upload-attachments-interface-backed-by-action/147350"]after I refresh[/quote]
&lt;p&gt;So not automatically after the action is complete?&lt;/p&gt;
&lt;p&gt;What is in `rule!FRR_GET_requestFolder()`?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147350?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 18:09:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:500c85d6-1f99-4f8c-b930-12d9f65e41cd</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;No, it is populated after I refresh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147349?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 18:07:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a4373149-2197-4f3e-89bc-c61b2f0008b1</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="160049" url="~/discussions/f/user-interface/38942/upload-attachments-interface-backed-by-action/147347"]I&amp;#39;ve attempted to set the&lt;span&gt;&amp;nbsp;local!existingFolderId a &amp;quot;refresh variable&amp;quot; with &amp;quot;record_action&amp;quot; refreshAfter&lt;/span&gt;[/quote]
&lt;p&gt;When you test from the interface designer, is the Folder ID getting populated after the action is completed, or no?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147347?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 17:59:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46427433-6e6d-43d0-ba8d-e2384ccb2789</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;I&amp;#39;ve attempted to set the&lt;span&gt;&amp;nbsp;local!existingFolderId a &amp;quot;refresh variable&amp;quot; with &amp;quot;record_action&amp;quot; refreshAfter but unfortunately, even when the user clicks refresh then uploads an attachment, it does not populate. Any other suggestions?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147332?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 14:37:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb191712-6d11-4e94-a778-99248a30f14f</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Would make&amp;nbsp;sense given that when I tried to reproduce that I had hard coded the folder id. Wasn&amp;#39;t aware if was being created dynamically.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147331?ContentTypeID=1</link><pubDate>Fri, 18 Apr 2025 14:29:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fa585b00-c03f-45b0-aaec-51b1923fd18f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Assuming the initial document is also creating the folder, as seen in your process flow, when the action is completed, the &amp;quot;existing attachments&amp;quot; is set to refresh after RECORD_ACTION, but the &amp;quot;existing folder&amp;quot; is not, so it will stay null, so &amp;quot;existing attachments&amp;quot; will automatically evaluate to null also.&lt;/p&gt;
&lt;p&gt;The simple solution is to also make local!existingFolderId a &amp;quot;refresh variable&amp;quot; with &amp;quot;record_action&amp;quot; refreshAfter, so the folder ID will populate, so the attachment variable will populate.&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/13/pastedimage1744986510728v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147320?ContentTypeID=1</link><pubDate>Thu, 17 Apr 2025 15:01:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:210c2fb7-8672-4ada-a8e3-04824e936910</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;&lt;img style="max-height:105px;max-width:730px;" alt=" " height="105" src="/resized-image/__size/1460x210/__key/communityserver-discussions-components-files/13/Screenshot-2025_2D00_04_2D00_17-090015.png" width="730" /&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your time in advance.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147319?ContentTypeID=1</link><pubDate>Thu, 17 Apr 2025 14:57:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:52f1dd26-9b50-43a3-b972-1dcddf995833</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Can you show your Process Model?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147318?ContentTypeID=1</link><pubDate>Thu, 17 Apr 2025 14:49:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4af43365-a8d3-4701-87d6-027a5897050d</guid><dc:creator>cindyl5142</dc:creator><description>&lt;p&gt;When I upload the initial attachment, it does not show up on the grid, regardless of chaining the process model. :(&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Upload Attachments Interface Backed By Action</title><link>https://community.appian.com/thread/147293?ContentTypeID=1</link><pubDate>Thu, 17 Apr 2025 01:21:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ced4fd3-1c0a-46f2-8991-e21f41923111</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Why do you need the refresh button? I tried your code (with a few mods) and it refreshes automatically.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!readonly: false,
  local!existingFolderId: cons!S_FOLDER_UPLOAD,
  local!existingAttachments: a!refreshVariable(
    value: if(
      a!isNullOrEmpty(local!existingFolderId),
      null,
      folder(
        local!existingFolderId,
        &amp;quot;documentChildren&amp;quot;
      )
    ),
    refreshAfter: &amp;quot;RECORD_ACTION&amp;quot;
  ),
  local!existingAttachmentData: a!refreshVariable(
    value: a!forEach(
      items: local!existingAttachments,
      expression: {
        /*custom dictionary for document properties*/
        name: document(fv!item, &amp;quot;name&amp;quot;),
        dateCreated: document(fv!item, &amp;quot;dateCreated&amp;quot;),
        lastModifiedBy: left(document(fv!item, &amp;quot;lastUserToModify&amp;quot;), 7),
        size: document(fv!item, &amp;quot;size&amp;quot;)
      }
    ),
    refreshafter: &amp;quot;RECORD_ACTION&amp;quot;
  ),
  a!columnsLayout(
    columns: {
      a!columnLayout(
        contents: {
          a!gridField(
            label: &amp;quot;Existing Attachments&amp;quot;,
            instructions: if(
              local!readonly = true,
              &amp;quot;&amp;quot;,
              &amp;quot;Newly added attachments may be delayed showing below, please use the refresh button.&amp;quot;
            ),
            data: local!existingAttachmentData,
            columns: {
              a!gridColumn(
                label: &amp;quot;Name&amp;quot;,
                sortField: &amp;quot;name&amp;quot;,
                value: a!linkField(
                  links: a!documentDownloadLink(
                    label: fv!row.name,
                    document: local!existingAttachments[fv!identifier]
                  )
                )
              ),
              a!gridColumn(
                label: &amp;quot;Date-Time Uploaded&amp;quot;,
                sortField: &amp;quot;dateCreated&amp;quot;,
                value: if(
                  isnull(fv!row.dateCreated),
                  &amp;quot;&amp;quot;,
                  todatetime(fv!row.dateCreated)
                )
              ),
              a!gridColumn(
                label: &amp;quot;File Size&amp;quot;,
                sortField: &amp;quot;size&amp;quot;,
                value: round(todecimal(fv!row.size) / 1024) &amp;amp; &amp;quot; KB&amp;quot;
              )
            },
            initialSorts: {
              a!sortInfo(field: &amp;quot;dateCreated&amp;quot;, ascending: false)
            },
            pageSize: 5
          ),
          a!sideBySideLayout(
            items: {
              a!sideBySideItem(
                item: a!recordActionField(
                  align: &amp;quot;END&amp;quot;,
                  actions: {
                    a!recordActionItem(
                      action: &amp;#39;recordType!{782cfd87-9585-410b-a55f-844c12b7beb1}S_Client.actions.{e9710958-2828-4798-8067-69b61309ccd6}uploadDoc&amp;#39;
                    )
                  }
                )
              )
            }
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>