Skip to main content
August 30, 2024
Question

fileUploadField saveInTo

  • August 30, 2024
  • 11 replies
  • 0 views

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 component while calling it. In saveInTo of the common component I am calling a!startProcess which will run asynchronously(i.e. no activity chaining). 

Issue: 

  1. When I drag and drop multiple documents to file upload, a!startProcess is being called multiple times. Is this behavior expected? i.e when I upload multiple docs at the same time, saveInTo will execute multiple times?
  2. Sometimes, when I upload multiple docs at the same time, getting the following error. (Especially when I upload 3 to 4 docs at the same time)

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error [evaluation ID = 50518:8f67a] in rule 'aco_fileuploadfield' : An error occurred while executing a save: Expression evaluation error : Attempted to run a second smart service, but only one smart service can be run per expression evaluation.

Note: I have built this functionality to capture document details across all apps and all upload fields which are already in use. We don't want to change any UI and major changes to existing screens.

11 replies

stefanhelzle0001
August 30, 2024

All of this is expected behaviour. Trying to build such a generic component, especially for file uploads is a challenging task.

At the end of this blog post, I give a short explanation of the way I do this kind of "File-upload Anywhere" component.

https://appian.rocks/2024/05/20/file-upload-in-appian/

mikes0011
Brainy
August 30, 2024

What is your StartProcess call actually doing?  Are you passing in the uploaded Doc IDs?  Are you doing so one at a time, or as an array?  I would note that these would be UN-submitted doc IDs most likely, and if so they probably won't do what you want (unless you're just noting the raw numeric IDs to a DB table or something).  Can you share a code snippet of how you're constructing this call, so we don't have to guess?

August 30, 2024

Hi Mike,

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.
It is working fine when I upload single document. But when I upload multiple, saveInTo is called two times and triggering two instances.
And also, when I upload 2 or more documents getting the below error.

Basically, I want to capture the document IDs uploaded in all fileUploadFields. However, most of our tables don't have records and also documents are stored in numerous different tables. Also, client don't want to see any visible changes in UIs

mikes0011
Brainy
August 30, 2024

I don't know if I can even guess at any suggestions (even assuming anything would work around this issue) without seeing the actual code.

Can you share a code snippet of how you're constructing this call, so we don't have to guess?
March 20, 2025

Hi [mention:12c78c8e4d544711a24da183fc01f4d5:e9ed411860ed4f2ba0265705b8793d05] , I am also facing the same issue did you find any solution to trigger process model only once?

stefanhelzle0001
March 20, 2025

What exactly do you mean with "same issue"?

March 20, 2025

Hi [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05] 

I am trying to change the filenames while uploading the files without submitting

I used a!submituploadfiles function to upload documents and triggering process model in saveInto to change doc names

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