1
0
-1

Dear All,

 

I am running a Joget cloud instance ;

Have two questions around the below scenarios;

A- trying to populate a select box value using 'user options binder' inside a form (which fetches the user information from 'dir_user' table).However, it only sets 'username' for respective selection. I need to get first name & last name instead, but didn't have much joy.

Test Procedure:

i) Create a form > define a select box ('batch owner" in my case)  with 'user options binder' > choose organization-department-group with handful of users in it. > set first name /last name for the label

ii) Create Datalist including the select box field in the above form 

iii) Launch the app and open the form > you may see the user first name/last name populated against select box field while creating form. select a value and submit form

iv) launch the fatalist > you will always see the username against the field linked with the select box in question.

Question1: Can any one suggest any easier way to achieve the above

B)The work around I am pursuing  for the above scenario is to access the backend DB table to pull the desired field with a SQL query. But unable to get the backend DB connected and successfully tested. I tried this via 'JDBC Datalist Database Binder'.

 

Test Procedure: {{ THIS CAN ONLY BE REPRODUCED on JOGET Cloud instance}}

i) Create a Data list

ii) Instead of form data binder, pick 'JDBC Datalist Database Binder'

iii) choose custom data source and note the JDBC connection details there

iv) The default value out there seems to be not right for the backend DB instance.

 

Question2: Anybody have idea on what would be the JDBC URL and credentials if I wanna access my Joget instance's schema/db?

 

 

Thanks in advance for your time.

 

Cheers,

Rash.

 

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Hello, regarding the first question about what to display in the listbox from the list of users, if you look closely, in the second screen of options in "label" you can choose to show:
       

      As you mentioned, you can not directly access the DB, due to the cloud configuration, however it is also possible to fill this type of element with bean shell, only it is a bit tricky. The first thing is, as Walter replied, that you use the default datasource. On the other hand uses standard sql in queries and do not use ";" At the end of the sentence.

      Although it is for something else, the following query:

      SELECT 
      CONCAT(app_fd_dom_ejes_proyecto.c_nom_eje, ' (', count(*)       , ')') as name,
      sum(
      TIMESTAMPDIFF(HOUR , concat('2000:01:01',' ',STR_TO_DATE(c_hora_inicio, '%H:%i')), concat('2000:01:01',' ',STR_TO_DATE(c_hora_final, '%H:%i'))) 
      )
      as horas 
      from 
      app_fd_spro_visitas,
      app_fd_dom_ejes_proyecto
      where 
      app_fd_spro_visitas.c_id_eje=app_fd_dom_ejes_proyecto.c_id_eje
      group by app_fd_dom_ejes_proyecto.c_nom_eje

       

      Produces this graph:

      1. Fabian Barrera

        Hola Camilo, requiero hacer una consulta de una tabla que es utilizada por varios formularios , estoy utilizando la BD por defecto ya que uso Joget Cloud, creé un data list y al ejecutar esta consulta: SELECT * FROM hr_expense_claim , me arroja el siguiente error : "Failed to retrieve a column list.Please Check Your Configuration" será que debo configurar algo adicional en la aplicación?

      2. Fabian Barrera

        Finalmente pude hacerlo con esta sentencia: SELECT * FROM app_fd_hr_expense_claim , debe anteponerse el string app_fd_ antes de cualquier tabla. gracias FBR

      CommentAdd your comment...
    2.  
      1
      0
      -1

      In your JDBC Datalist Database Binder, choose "Default Datasource" instead of "Custom Data Source"

        CommentAdd your comment...