Joomla 6 Notice

We are pleased to announce that all our Joomla extensions have been compatible with Joomla 6 since October 14th, 2025.

For those currently upgrading from Joomla 3 to 4: Instructions for Joomla 4 migration can be found here:

There are standalone documentations Visforms Joomla 4, Visforms Joomla 5 and Visforms Joomla 6.

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

Populate Field with Info Related to User Group

More
4 weeks 18 hours ago #12298 by herb200mph
Our client would like a data field automatically populated when a user from a specific group logs in.

An example would be:

A JOOMLA6 User Group has only ACCOUNTANTS allowed access with a common user name and password.
When logged in, it opens a form, the first field of the form pulls the name of the specific user group for ACCOUNTANTS.

Another group might be BOOKKEEPERS and when they login with their unique user name and password, the first line of the form would display BOOKKEEPERS.

Can anyone guide us, or give us the code needed to pull this off in Visforms?

Thank you in advance for any assistant provided.


 

More
3 weeks 5 days ago #12299 by Administrator IV
Replied by Administrator IV on topic Populate Field with Info Related to User Group
Greetings herb200mph,

Re: a data field automatically populated when a user from a specific group logs in

One possible solution is to use custom SQL.
You could use a text field with an SQL configuration—specifically within either the 'Default Value Settings' or 'Dynamic Settings' section.
You can find these settings in the field configuration under the 'Basic Settings' tab.

This solution allows you to implement many of the details you have in mind—even those not explicitly mentioned here—ensuring the final result works exactly as you envision.

The solution involves using Visforms placeholders within SQL statements in the field configuration (e.g., for a text field).
Visforms placeholders:
docs.joomla-6.visforms.vi-solutions.de/e...isforms-placeholder/
SQL fields (text type):
docs.joomla-6.visforms.vi-solutions.de/e...s-text-typed-fields/
Examples of forms with SQL fields:
docs.joomla-6.visforms.vi-solutions.de/e...-types/sql/examples/

Regarding the necessary Visforms placeholder:
In your case, you would use the placeholder for the logged-in user's ID within the SQL statement.
Your SQL statement would use the user ID to retrieve the name of an expected or specific user group by querying the relevant Joomla tables.
The SQL logic of your statement then determines the value that appears in the text field—or whether anything appears at all.
Joomla User object:
docs.joomla-6.visforms.vi-solutions.de/e.../#joomla-user-object

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 6:
docs.joomla-6.visforms.vi-solutions.de/en/docs/
Please ask only 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 6:
docs.joomla-6.visforms.vi-solutions.de/docs/
Bitte immer nur 1 Frage pro Thema stellen :-).

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum