I want to upload the file and save it into the database in integer form. How can I do it?
Discussion posts and replies are publicly visible
Hi shrutij9485,
Please try below code. It will save the document in documents folder and document ID to database table
a!formLayout( label: "Form", contents: { a!cardLayout( contents: { a!fileUploadField( label: "File Upload", labelPosition: "ABOVE", target: cons!PDS_DOCUMENT_FOLDER, value: ri!Document.documentId, saveInto: a!save(ri!Document.documentId, save!value), validations: {} ) }, height: "AUTO", style: "NONE", marginBelow: "STANDARD" ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidgetSubmit( label: "Submit", saveInto: a!writeToDataStoreEntity(cons!PDS_DATASTORE_DOCUMENT_CONSTANTS, ri!Document, "Success", ""), submit: true, style: "PRIMARY" ) } ) )
I tried this solution but in process model itis showing that data cannot be written in database
The above solution is generally correct - if you're having further issues then you'll need to provide more detail with respect to exactly what you're trying and exaclty what error you're receiving in the process instance.
Hey Mike I tried the solution it works but only if 1 doc is being uploaded, is there any way where I can upload multiple docs?, because I tried uploading multiple but it only gets the first one selected and not the other
Yeah, You can upload multiple docs at a time. You have to make sure that your variable must be a list of number integer array. And check maxSelection parameter value which shouldn't be 1, If it is 1 then you can just select only one file not multiple files.