Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By andreaadamczyk

You can create an array type variable, and in a trigger before the output document, set the value of that variable with the array.

Then, in the HTML editor of the output document you can use this code to create the document:
Code: Select all
<table width="100%" border="1">
<[email protected]>GRID-VARIABLE-NAME-->
<td width="25%">@#Field1</td>
<td width="25%">@#Field2</td>
<td width="25%">@#Field3</td>
<td width="25%">@#Field4</td>
<[email protected]<GRID-VARIABLE-NAME-->
Where the "GRID-VARIABLE-NAME" is the name of the array variable you created before, and the "Field-X" are the fields of the array.

I hope this information would help you.

Please, let me know how it goes.

By fibo2358
Hello ,

Thank you very much, that worked fine.
I guess that the documentation should be updated, it is not obvious that the solution used in grids may be applied to the arrays.
I will enter a separate post for this update.

Best Regards,
User avatar
By amosbatto
HeshanKaru1994 wrote:Can you show a sample code in use with more details as i'm new to processmaker
Where you unable to follow this example?

Are you editing the HTML code in your template? (Look for the "HTML" button in the template editor.)
Are you matching the exact spelling for your Grid variable and the IDs of the fields inside the grid?

If you still can't figure it out, then post your process and indicate which dynaform has the grid and which Output Document should have the inserted grid.
User avatar
By amosbatto
HeshanKaru1994 wrote: Fri Apr 19, 2019 5:49 am Inside a trigger I am generating array of items(without using grids) and I want that array to be shown inside a html table in a template document
You can use trigger code like this to create an array that looks like a grid to ProcessMaker:
Code: Select all
@=myGrid = array(
  1 => array( 'field1' => 'row1value1', 'field2' => 'row1value2', 'field3' => 'row1value3'),
  2 => array( 'field1' => 'row2value1', 'field2' => 'row2value2', 'field3' => 'row2value3'),
  3 => array( 'field1' => 'row3value1', 'field2' => 'row3value2', 'field3' => 'row3value3')

Then use this in the HTML code of your template file:
Code: Select all
<table width="100%" border="1">
<tr><th>My Field 1</th><th>My Field 2</th><th>My Field 3</th></tr>
<!-- @>myGrid -->
<td width="32%">@#field1</td>
<td width="32%">@#field2</td>
<td width="32%">@#field3</td>
<!-- @<myGrid -->
Warning SMTP Error: Data not accepted

warn.PNG Getting this warning and I dont know w[…]

Grid dropdown

Is there a way to check selected option(dropdown g[…]

Timezone issue

Hi, the problem is that when I insert the data to […]

Hi, I set permission PM_EDITPERSONALINFO for oper[…]