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

Moderators: ArturoRobles, ArturoRobles

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 Throwaway
#793133
I am attempting to pull the entered information from a grid. Assuming this is the grid and you cannot add/remove rows. How would I pull this specific data http://imgur.com/CMg1SZJ

Basically how would I pull the date from the grid variable?

$pdf->Write(0, $variables->Grid1['Lastname']);
User avatar
By amosbatto
#793139
In a trigger, you can use this code, if your grid variable is "mygrid" and the IDs of the grid fields are "firstName", "lastName" and "middleName":
Code: Select all
if (isset(@=mygrid) and count(@=mygrid) >= 2) {
  //data from the first row, stored in local variables
  $first1 = @=mygrid[1]['firstName'];
  $middle1 = @=mygrid[1]['middleName'];
  $last1 = @=mygrid[1]['lastName'];
  //data from the second row, stored in case variables
  @@first2 = @=mygrid[2]['firstName'];
  @@middle2 = @=mygrid[2]['middleName'];
  @@last2 = @=mygrid[2]['lastName'];
}
Set the above trigger to fire at some point after the DynaForm.

Then you can use @@first2, @@middle2 and @@last2 in a subsequent trigger or #first2, @#middle2 and @#last2 in your Output Document or email template.
By Throwaway
#793153
amosbatto wrote:In a trigger, you can use this code, if your grid variable is "mygrid" and the IDs of the grid fields are "firstName", "lastName" and "middleName":
Code: Select all
if (isset(@=mygrid) and count(@=mygrid) >= 2) {
  //data from the first row, stored in local variables
  $first1 = @=mygrid[1]['firstName'];
  $middle1 = @=mygrid[1]['middleName'];
  $last1 = @=mygrid[1]['lastName'];
  //data from the second row, stored in case variables
  @@first2 = @=mygrid[2]['firstName'];
  @@middle2 = @=mygrid[2]['middleName'];
  @@last2 = @=mygrid[2]['lastName'];
}
Set the above trigger to fire at some point after the DynaForm.

Then you can use @@first2, @@middle2 and @@last2 in a subsequent trigger or #first2, @#middle2 and @#last2 in your Output Document or email template.
Would there be another way if I am already pulling them via REST? The PHP I am adding for this is from a library outside of ProcessMaker.
REST API Question

I am currently looking at developing a portlet for[…]

Everybody wants to be famous, but nobody wants to […]

Hi, I attached a sample config file, Please check […]

Error clicking on Participated

Hi, I attached a sample config file, Please check […]