<?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>fileUploadField saveInTo</title><link>https://community.appian.com/discussions/f/general/37428/fileuploadfield-saveinto</link><description>Scenario: I have a created a reusable fileUploadField component which I am planning to use in all existing fileUploadField field in all apps. I have created a rule inputs for all the parameters of the fileUpload field and passing values to the common</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/146427?ContentTypeID=1</link><pubDate>Fri, 21 Mar 2025 00:12:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:43b63e97-e740-4362-95f2-116d0076c292</guid><dc:creator>shivakanthreddyp0001</dc:creator><description>&lt;p&gt;As Stefean mentioned you can only call smart service functions once.&amp;nbsp;If you want to change the file names, best way is do that in process model after uploading to target folder.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/146421?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 20:09:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e4d9b760-b8fa-4514-a417-91c6f2511fef</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You can only use a single smart service function in a saveInto. You will have to find a different way.&lt;/p&gt;
&lt;p&gt;BTW, why do you need to change file names?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/146418?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 16:08:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0791fed3-34bc-4aaf-8a9f-7731ead664d0</guid><dc:creator>Narasimha Reddy</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/stefanhelzle0001"&gt;Stefan Helzle&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am trying to change the filenames while uploading the files without submitting&lt;/p&gt;
&lt;p&gt;I used a!submituploadfiles function to upload documents and triggering process model in saveInto to change doc names&lt;/p&gt;
&lt;p&gt;when i am uploading multiple docs saveInto executing multiple times with respect to number of docs. if i upload 3 documents at a time 3 instances are getting created and throughing error as cant execute smartservice second time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/146413?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 15:15:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ebdbf10b-b39a-4074-8670-ec32213747a3</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;What exactly do you mean with &amp;quot;same issue&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/146410?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 14:48:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:26365ff1-5701-4f45-b7ab-7304542374eb</guid><dc:creator>Narasimha Reddy</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi &amp;nbsp;, I am also facing the same issue did you find any solution to trigger process model only once?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/140133?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2024 15:19:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:67e7d169-64fb-4651-8f32-18feb583c0f7</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;So I&amp;#39;m afraid the plain answer here is that this has grown too bloated for its own good - the File Upload Field is already not very flexible sadly, and you&amp;#39;re trying to make it do everything all at once.&amp;nbsp; Having a single File Upload Field handle multiple files is already pretty clumsy even when the use case and implementation is strictly kept pretty simple - and i fear this is an example of what happens otherwise.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For better or worse I pretty much never use a multiple-enabled upload field anywhere unless i&amp;#39;m doing a VERY SIMPLIFIED bulk upload (and even then it&amp;#39;s super rare).&amp;nbsp; All other times I enforce that my forms deal with a single upload at a time (or at least a single upload per instance of the upload field); often I force a &amp;quot;submit&amp;quot; click if possible (or some other commit click etc).&amp;nbsp; Either of these approaches (despite the fact that they would both violate the requisites you laid out) would likely solve the &amp;quot;multiple smart services&amp;quot; issue as the upload field attempts to loop over the newly-uploaded files and inadvertently tries to launch multiple startProcess calls.&amp;nbsp; Sadly I don&amp;#39;t think current functionality exists to let you get around this without *some* compromise.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/140131?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2024 14:56:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:027ad430-64b8-4e33-a999-7139e2a647db</guid><dc:creator>riyazn399986</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  /*Contains all documents uploaded in file upload*/
  local!allUploadedDocuments: a!refreshVariable(
    value: ri!value,
    refreshOnReferencedVarChange: false
  ),
  /*Contains documents which are active in file upload field*/
  local!activeDocuments: a!refreshVariable(
    value: ri!value,
    refreshOnReferencedVarChange: false
  ),
  /*Contains all documents which needs to be deleted*/
  local!documentsToDelete,
  a!fileUploadField(
    label: ri!label,
    labelPosition: a!defaultValue(value: ri!labelPosition, default: &amp;quot;ABOVE&amp;quot;),
    instructions: ri!instructions,
    helpTooltip: ri!helpTooltip,
    target: ri!target,
    fileNames: ri!fileNames,
    fileDescriptions: ri!fileDescriptions,
    maxSelections: ri!maxSelections,
    value: local!activeDocuments,
    saveInto: {
      a!save(local!activeDocuments,save!value),
      ri!saveInto,
      a!save(
        local!allUploadedDocuments,
        reject(
          a!isNullOrEmpty(_),
          union(
            tointeger(local!activeDocuments),
            tointeger(local!allUploadedDocuments)
          )
        )
      ),
      a!save(
        local!documentsToDelete,
        difference(
          tointeger(local!allUploadedDocuments),
          tointeger(local!activeDocuments)
        )
      ),
        a!startProcess(
          processModel: cons!ACO_PM_INSERT_AND_DELETE_DOCUMENT_DETAILS,
          processParameters: {
            activeDocs: local!activeDocuments,
            deletedDocs: local!documentsToDelete,
            appID: ri!appID,
            requestID: ri!requestID,
            documentTags: ri!documentTags
          },
          onSuccess: {
            a!save(
              local!allUploadedDocuments,
              difference(
                tointeger(local!allUploadedDocuments),
                tointeger(local!documentsToDelete)
              )
            ),
            a!save(
              local!documentsToDelete,
              null
            )
          }
        )
    },
    required: a!defaultValue(value: ri!required, default: false),
    requiredMessage: ri!requiredMessage,
    disabled: a!defaultValue(value: ri!disabled, default: false),
    validations: ri!validations,
    validationGroup: ri!validationGroup,
    buttonStyle: a!defaultValue(
      value: ri!buttonStyle,
      default: &amp;quot;SECONDARY&amp;quot;
    ),
    buttonSize: a!defaultValue(value: ri!buttonSize, default: &amp;quot;SMALL&amp;quot;),
    accessibilityText: ri!accessibilityText,
    showWhen: a!defaultValue(value: ri!showWhen, default: true),
    uploadMethods: ri!uploadMethods,
    buttonDisplay: ri!buttonDisplay,
    placeholder: ri!placeholder,
    showVirusScanMessage: a!defaultValue(
      value: ri!showVirusScanMessage,
      default: false
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Above code the common component which can be called in all existing fileUploadField.&lt;/p&gt;
&lt;p&gt;In process model writing and deleting the data from DB.&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1725029779982v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/140130?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2024 14:47:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5795530d-81e5-47ff-8c38-be125b98d29e</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if I can even guess at any suggestions (even assuming anything would work around this issue) without seeing the actual code.&lt;/p&gt;
[quote userid="50400" url="~/discussions/f/general/37428/fileuploadfield-saveinto/140127"]Can you share a code snippet of how you&amp;#39;re constructing this call, so we don&amp;#39;t have to guess?[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/140129?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2024 14:39:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:28b2598b-a381-4100-b2f9-17bf8822999d</guid><dc:creator>riyazn399986</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am trying to capture the Document IDs and constructing the CDT to have some other data points. And calling the process to write this data to DB.&lt;br /&gt;It is working fine when I upload single document. But when I upload multiple, saveInTo is called two times and triggering two instances.&lt;br /&gt;And also, when I upload 2 or more documents getting the below error.&lt;br /&gt;&lt;br /&gt;Basically, I want to capture the document IDs uploaded in all fileUploadFields. However, most of our tables don&amp;#39;t have records and also documents are stored in numerous different tables. Also, client don&amp;#39;t want to see any visible changes in UIs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/140127?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2024 14:13:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:50046545-7e10-4495-b171-8dc853b44dbc</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;What is your StartProcess call actually doing?&amp;nbsp; Are you passing in the uploaded Doc IDs?&amp;nbsp; Are you doing so one at a time, or as an array?&amp;nbsp; I would note that these would be UN-submitted doc IDs most likely, and if so they probably won&amp;#39;t do what you want (unless you&amp;#39;re just noting the raw numeric IDs to a DB table or something).&amp;nbsp; Can you share a code snippet of how you&amp;#39;re constructing this call, so we don&amp;#39;t have to guess?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fileUploadField saveInTo</title><link>https://community.appian.com/thread/140121?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2024 11:33:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:717ae762-2acc-482f-9e47-621ecdc85482</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;All of this is expected behaviour. Trying to build such a generic component, especially for file uploads is a challenging task.&lt;/p&gt;
&lt;p&gt;At the end of this blog post, I give a short explanation of the way I do this kind of &amp;quot;File-upload Anywhere&amp;quot; component.&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://appian.rocks/2024/05/20/file-upload-in-appian/"&gt;https://appian.rocks/2024/05/20/file-upload-in-appian/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>