Hey All,
I am not getting the document upload in the portal into Appian Environment. i used a!submitUploadedFiles() as well
a!buttonWidget(label: "Submit",submit:true(),saveInto: {/*a!verifyRecaptcha(),*/rule!PA_InsertDataIntoDB(userInfo: local!userInfo,onSuccess: {a!submitUploadedFiles()})})
Discussion posts and replies are publicly visible
Can you share what the rule PA_InsertDataIntoDB is doing? Assuming it uses a!writeToDataStoreEntity(), does the write to the database work successfully? What troubleshooting steps have you tried? Are you receiving any error messages?
Data is written into DB successfully. Basically,PA_InsertDataIntoDB is calling the web service to write the data into DB.
If you run something else in the `onSuccess` property, does that execute successfully?
Can you share what the expression for your a!fileUploadField looks like? Make sure your service account that you configured when publishing the portal has editor access to the folder you are uploading to.
docs.appian.com/.../portals-documents.html
a!localVariables(local!file,local!userInfo: 'type!{urn:com:appian:types:PA}PA_UserInformation'(),a!formLayout(label: "User Information",contents: {a!columnsLayout(columns: {a!columnLayout(contents: {a!textField(label: "User Name",value: local!userInfo.userName,saveInto: local!userInfo.userName),a!textField(label: "Full Name",value: local!userInfo.fullName,saveInto: local!userInfo.fullName),a!textField(label: "Manager/Supervisor Name",value: local!userInfo.managerName,saveInto: local!userInfo.managerName)}),a!columnLayout(contents: {a!textField(label: "Designation",value: local!userInfo.designation,saveInto: local!userInfo.designation),a!textField(label: "Department",value: local!userInfo.department,saveInto: local!userInfo.department),a!textField(label: "PAN/SSN",value: local!userInfo.PAN_SSN,saveInto: local!userInfo.PAN_SSN)}),a!columnLayout(contents: {a!radioButtonField(label: "Gender",choiceValues: { "Male", "Female" },choiceLabels: { "Male", "Female" },value: local!userInfo.gender,saveInto: local!userInfo.gender),a!fileUploadField(label: "Resume/CV",value:local!file,saveInto: {local!file,local!userInfo.resume_CV},maxSelections: 1,target: tofolder(4704))})})},buttons: a!buttonLayout(primaryButtons: a!buttonWidget(label: "Submit",submit:true(),saveInto: {/*a!verifyRecaptcha(),*/rule!PA_InsertDataIntoDB(userInfo: local!userInfo,onSuccess: {a!submitUploadedFiles()})}))))
This is the whole code.
Yes, that service account has editor access to the folder
Thanks. Make sure you are following this note:https://docs.appian.com/suite/help/22.2/portals-documents.html#security-and-service-accounts:~:text=WARNING%3A%20To%20write%20CDT%20data%20with%20document%20IDs%20from%20uploaded%20files%20to%20a%20database%20through%20an%20integration%2C%20the%20document%20field%20within%20the%20CDT%20that%20you%27re%20writing%20must%20be%20of%20type%20Number(Integer)%2C%20not%20Document.%20An%20incorrect%20field%20type%20can%20cause%20the%20data%20and%20document%20IDs%20to%20not%20save%20properly.
Also, I'm not sure if this could be impacting the behavior you are seeing in the portal, but as a best practice, you should not be referencing a folder by it's id. Instead, create a constant that points to the folder. This will ensure the reference to the folder works correctly.
One last thing, it sounds like you are aware of this, but the file upload will only work from the portal, not in interface designer, so make sure you are testing from the the portal.
BTW, please insert long code like this into a Code Box, so it maintains indentation / readability and doesn't destroy the page length of the comment section (which severely impacts overall readability).
Hello Deepak, Have you fixed this issue? I'm having the same problem.The file is not uploaded to the folder.When I use a!submitUploadedFiles(), it gives me the error APNX-1-4561-007.
a!submitUploadedFiles(),
Appian provided a description of the error, but it doesn't explain how to fix it.
Anyone know how to fix this issue?
Hello Alex, I'm having the same problem.The file is not uploaded to the folder.When I use a!submitUploadedFiles(), it gives me the error APNX-1-4561-007.
Have you already tried the tips that Alex and Pete offered earlier in this thread?
Hello John, Yes, I did. I am able to save the document ID in the database, but not the file in the target folder.
FYI.. I am using Appian Community Edition free version for POC. Is that the problem?