Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Fields of Community Builder in Balbooa Forms

1 month 1 week ago #1

  • Wouter's Avatar
  • Wouter
  • Posts: 105
I have a feature request for Balbooa Forms.

I have created a form that is only visible to logged in users.
I would like to have fields such as first name, last name, telephone number automatically filled in.
The source is the user list in Community Builder.

Is this a new feature you can build in Forms?

1 month 1 week ago #2

  • Artem's Avatar
  • Artem
  • Posts: 9903

It's already can be done. Balbooa Forms allows you to set a default value for input fields. So, you can use the SQL query data tag, screen attached.

SQL query data tag allows inserting data from the database, for example
[SQL query = SELECT `username` FROM `k_users` WHERE `id` = 153;]


1 month 1 week ago #3

  • Wouter's Avatar
  • Wouter
  • Posts: 105
That's very beautiful. I hadn't found that yet.
But with the SQL query you wrote I always get the same user.
For example, I would like to find and display the first name of the logged in user in the Forms field.
Do you know from which table I can get that?
In the table comprofiler I see all the data of the users, but I am missing a value there that shows that it concerns the logged in user.

It's not actually a support question for Balbooa Forms, but maybe someone here knows the answer.

1 month 1 week ago #4

  • Wouter's Avatar
  • Wouter
  • Posts: 105
At an other forum I received this as a possible solution:
$user   = JFactory::getUser();
$db   = JFactory::getDbo();
$userId  = $user->get('id');
// Is the user logged in?
if ($userId) {
  // Grab the value from the database.
    $db->setQuery("SELECT `firstname` FROM `#__comprofiler` WHERE `user_id`='".$userId."'");
    return $db->loadResult();
But in Forms I only have the field "Default value" wher I choose for the SQL query.
How can I make this work in Forms?

3 weeks 1 day ago #5

  • Wouter's Avatar
  • Wouter
  • Posts: 105
Is there anyone here with knowledge of SQL queries who can help me write some code that enables the data retrieval?
And that code must then be able to fit into that SQL field of Balbooa Forms.
Powered by Kunena Forum