Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
#814886
First of all, do you know PHP and JavaScript? If not, go hire a programmer to help you.

It would be much easier if your users would export their Excel files as CSV files and then upload them to ProcessMaker, because no extra libraries will be needed to read the file. If you must have an Excel file, then follow these instructions to install PHPExcel on your ProcessMaker server. Also study the code example to learn how to use PHPExcel.

Then, create a MultipleFile field in your DynaForm to upload the Excel file.

Then, add a trigger to your process to open the Excel file and extract the information that you want and set its contents in a case variable named "excelContents".

You will need to query the APP_DOCUMENT table like this:
Code: Select all
$fileVarName = "uploadExcelFile";  //set to the variable name of your MultipleFile field.
$caseId = @@APPLICATION;
//get last uploaded document to the MultipleFile field:
$sql = "SELECT * FROM APP_DOCUMENT 
   WHERE APP_UID='$caseId' AND APP_DOC_FIELDNAME='$fileVarName' AND 
   APP_DOC_STATUS='ACTIVE' ORDER BY APP_DOC_CREATE_DATE DESC";
$aFiles = executeQuery($sql);
@=excelContents = array();

if (!empty($aFiles)) {
     $fileId = $aFiles[1]['APP_DOC_UID'];
     $version =  $aFiles[1]['DOC_VERSION'];
     //add your code here to use PHPExcel to open the file and extract the information
     //and save it to @=excelContents
}
Then, in your DynaForm, add JavaScript to call the POST cases/{app_uid}/execute-trigger/{tri_uid} endpoint to execute the above trigger and then call the GET cases/{app_uid}/variables endpoint to retrieve the "excelContents" variable.

See this JavaScript example:
viewtopic.php?t=713486#p795059
And see the documentation for Files and Input Documents to learn how ProcessMaker stores files.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]