Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#815838
Hi All,

I have a process where in first Dynaform, i have used grid containing file upload and textbox.
I followed processmaker wiki https://wiki.processmaker.com/3.0/File_ ... es_in_grid to display filename, link, uploader name in next dynaform, which ran successfully :) . In my case i just want to show filename, link and value of that textbox for each attachment.
I tried making some changes in trigger given in sample process of that wiki to display textbox alongside the filename and its link to download file in next dynaform , but i am not able to get textbox values from Grid.

How to retrieve values of textbox fields from grid and display within grid?


I am using processmaker version 3.0.1.8 Community release
#815852
If you upgrade to a more recent version of PM, you can use MultipleFile fields in your grid, which make it possible to redisplay the files uploaded in a grid in a previous DynaForm without any extra coding.

However, you can add a text field to the grid whose ID is "extraInfo". Then, change your trigger code from:
Code: Select all
   @=FilesList[$i] = array(
      'fileName' => $row['CON_VALUE'],
      'fileLink' => $inputDocPath,
      'uploader' => $uploader,
      'date'     => $row['APP_DOC_CREATE_DATE'],
   );
To:
Code: Select all
   @=FilesList[$i] = array(
      'fileName' => $row['CON_VALUE'],
      'fileLink' => $inputDocPath,
      'extraInfo' => "Text that I want to add to each row"
   );

If the text you want to add to each grid row comes from a field associated a variable set in a previous Dynaform, then use this code:
Code: Select all
   @=FilesList[$i] = array(
      'fileName' => $row['CON_VALUE'],
      'fileLink' => $inputDocPath,
      'extraInfo' => @@myVariable
   );


If you have an existing grid variable, and you want to add the uploaded files to each row in the grid, then use this code:
Code: Select all
   @=FilesList[$i]['fileName'] = $row['CON_VALUE'];
   @=FilesList[$i]['fileLink'] =  $inputDocPath;
#815858
Hi,

Thank you for reply....

I tried your below mentioned solution.
Code: Select all
@=FilesList[$i] = array(
      'fileName' => $row['CON_VALUE'],
      'fileLink' => $inputDocPath,
      'extraInfo' => "Text that I want to add to each row"
   );
if I manually send the value in Triggers it is working and shown values in second Grid form in text field.
Currently I require first Dyna form using "Textbox" value which has name as "File Description" in Grid to show in second dyna form in Grid with "Textbox" Field.

Textbox in grid does not have variable so what should I pass in following code
Code: Select all
 @=FilesList[$i] = array(
      'fileName' => $row['CON_VALUE'],
      'fileLink' => $inputDocPath,
      'extraInfo' => @@myVariable
   );
Kindly refer attached Images and suggest how to retrieve values of textbox fields from grid and display within grid?

Grid.png
Grid.png (21.72 KiB) Viewed 10029 times
Grid2.png
Grid2.png (12.41 KiB) Viewed 10029 times
#822018
This solution only works if I have 2 tasks in which it shows documents and respective description in second task but in my case I have more than 10 tasks in my process.
I want to display attachments and descriptions from every tasks into its next task

Can you please help me here :|

I have some dependency on processmaker-3.0 hence I cannot upgrade processmaker.
#822121
Because the code you shared displays documents from previous task only.
Example:
Your code displays documents and description attached in 1st task in the 2nd task but documents from 1st task will not get displayed in third task. because I cannot use same grid variable for upload and download of attachments in 2nd form.

What I want is to see is all the documents and respective description attached till now on case to display in any current task and not the documents attached in last task only.

Currently I am using this https://wiki.processmaker.com/3.0/File_ ... es_in_grid method to display all the documents uploaded on the case.
#822137
That programming example (https://wiki.processmaker.com/3.0/File_ ... es_in_grid) should not be used if you have more than one File field, because the query does not search for a particular field. You need to use the programming example that I gave you because the database query searches for the particular File field and places the files in the correct position in the grid.

You need to give your users Process Permissions so that they can access the Input Document which is associated with the File field and the Dynaform which holds the File field. That will solve your problem about being to access the files in later tasks in the case.

Create a sample process in English that shows what you want to do and post the .pmx file, so that I understand better what you want.
#822210
for your example I have attached screenshots in my my previous comment.
On every task I have two grids one for upload and one for displaying already attached documents from previous tasks.
    Upload grid will have file upload web control and description text box in every row.
    Display grid will show all the documents from previous tasks with filename, link to download, name of the uploader and Description textbox value for that particular attachment.
See if its good for you or you will need a process file then I will make one short one.

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]

A Bet365 Clone Script is essentially a ready-made […]