Share ideas, ask questions, and get feedback about developing for ProcessMaker

Moderator: amosbatto

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.
Can I connect to firebird database?

If you want to connect the database remotely using[…]

Task with multiple users

Well i have worked for days on this project and th[…]

Multilple Flow Possibility

Hi Is it possible to have multiple flow in a sing[…]

Hi, Please tell to processmaker team for tran[…]