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.
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:
$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:
And see the documentation for Files and Input Documents to learn how ProcessMaker stores files.
Send for clarification

Cost: Will you be using PM entrerprise or open sou[…]

SMS Gateway

Hello natesh, I have a Get ready to use integrate[…]

delete information after CSV export

thanks for your attention, i have some change on y[…]

Thanx again amosbatto... I'll re-check file permis[…]