Joomla 5 Mitteilung

Wir freuen uns mitteilen zu können, dass seit dem 29. Januar 2024 alle unsere Joomla Erweiterungen mit Joomla 5 kompatible sind.

Für alle die gerade noch von Joomla 3 auf 4 aktualisieren: Anleitungen für die Joomla 4 Migration gibt es hier:

Es gibt nun auch eine eigenständige Dokumentation für Visforms für Joomla 4 und für Visforms auf Joomla 5

Forum

Visforms Subscription Inhaber können in unserem Forum Fragen stellen. Bitte mit dem entsprechenden Benutzer anmelden.
Jeder kann lesend auf das Forum zugreifen.

Bitte stellen Sie nur 1 Frage pro Thema.

Wichtig Angaben für fast jede Frage:
V1: Welche Visforms-Version läuft?
V2: Welche Joomla-Version läuft?
V3: Welche PHP-Version läuft?

Aufgrund von Feiertagen und Urlaub ist bei Anfragen im Forum in der Zeit vom 20. Dezember 2024 bis zum 8.Januar 2025 mit verlängerten Antwortzeiten zu rechnen.

Import data into forms

Mehr
3 Monate 2 Wochen her #10731 von rusasadmins
Import data into forms wurde erstellt von rusasadmins
I need to import 1,000 records into a form that I have created.

I have a csv file
I have created the form

I manually entered a few rows into the form, so I could see how the data sits.

Here is an example of the data via sql:
Code:
(2, 1, '2024-09-04 14:50:28', 160, NULL, NULL, '165.230.225.214', '0000-00-00 00:00:00', 0, 0, '01:013:111', 'The Bible in Aramaic', '3', 'HST\0, AHp', 'AMESALL: African, Middles Eastern, and South Asian Languages and Literature', 'Yes', NULL)
For the field with 'HST\0, AHp', since \0 isn't a printable character, how can I format my data so I can import into the field that has a multiple select values?

I'm using ROCSVI to run the import, which it can do easily my only issue is the field with multiple values.

Can you tell me how I can do this? I really don't want to do it manually.

thanks,
Laura

Code:
 

Mehr
3 Monate 2 Wochen her - 3 Monate 2 Wochen her #10735 von Administrator IV
Administrator IV antwortete auf Import data into forms
Hello Laura,

SQL statements are a possible and very good way to add any external data to a form as form data.
That is obviously your intention.

In order to be able to display non-printable characters in the SQL statement, MySQL has so-called:
'Special Character Escape Sequences'.
And that is exactly what you can see in your SQL example.

String Literals:
dev.mysql.com/doc/refman/8.4/en/string-literals.html

Re: since \0 isn't a printable character
No, \0 is a printable string literal, which you can read here.

\0 stands for the 'binary zero', and the 'binary zero' is the non-printable character.
\0 stands for a non-printable character.

An example:

For the listbox with multiple selection with field ID=636, the multiple selection of 'value2' and 'value3' is set using an SQL statement.
The following SQL statement is correct and is the only way it is possible.
In the database field, there is then a 'binary zero' directly after 'value2'.
A 'binary zero' in a database field is a normal case that occurs quite frequently.
Code:
update jx_visforms_60 set F636 = "value2\0, value3" where id = 1;

As I said, \0 is readable/writable and a 'binary zero', on the other hand, is the non-printable character.
If you work with readable, editable SQL statements (e.g. in a file), then there is no other option.

Working with a tool:

If your tool cannot handle non-printable characters (export and import with the same tool), you should
- Ask the tool provider.
- Use a different tool.

Other options 1:

All other options for developers lead more or less to the same thing.
A file is created from the existing data, in whatever way, which consists of a series of individual SQL statements.
Each individual SQL statement adds a record with the form data to the data table.
In the SQL statement, all non-printable characters are in a 'special character escape sequence'.
This file can then be read in and processed using common database editors or on the command line (see below).

Creating the readable file with the SQL statements, based on any external data table, is then an individual development task.

Other options 2:

Assuming the optimal case that the table structure of the source table and the form data table match, you can do the following.

- Export the table with mysqldump.exe
General:
mysqldump.exe [database-name] --result-file=[path-to-file]\[file-name].sql [source-tablename]
My example:
mysqldump.exe developj5 --result-file=C:\tmp\dump.sql jx_visforms_6

- Delete all lines in dump.sql that do not start with 'INSERT INTO'.

- Import the file with mysql.exe
General:
mysql -u [database-user] -p[password] [database-name] < I:\SandBox-IV\Java\mis\mis\sql\mis.sql
My example:
mysql -u devuser -p236598452XX developj5 < C:\tmp\dump.sql

The contents of dump.sql:
Code:
INSERT INTO `jx_visforms_60` VALUES (1,1,'2024-09-06 06:39:03',0,NULL,NULL,'172.20.0.1','0000-00-00 00:00:00',0,0,'value2\0, value3',NULL,NULL,'value-1\0, value-2 '); INSERT INTO `jx_visforms_60` VALUES (2,1,'2024-09-06 06:43:09',0,NULL,NULL,'172.20.0.1','0000-00-00 00:00:00',0,0,'value1\0, value3',NULL,NULL,'value-1\0, value-3');

The two new additional form data records are then read in correctly.
The multiple selection of the two list boxes is retained.


Best regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Letzte Änderung: 3 Monate 2 Wochen her von Administrator IV.

Mehr
3 Monate 2 Wochen her #10736 von rusasadmins
rusasadmins antwortete auf Import data into forms
Thank you very much, I will give this a try!

Mehr
3 Monate 2 Wochen her #10737 von Administrator IV
Administrator IV antwortete auf Import data into forms
Hello Laura,

you are very welcome.

Addendum:
The above example with the command line tools for MySQL ran on my local computer.
Depending on the provider package and what options it contains, the same thing works just as easily remotely.
Provided your provider supports it and the MySQL server is configured accordingly.

Connecting to the MySQL Server Using Command Options:
dev.mysql.com/doc/refman/8.4/en/connecting.html

How to connect to MySQL from the command line:
stackoverflow.com/questions/5131931/how-...rom-the-command-line

There are just 3 command line parameters added:
Code:
mysql -h [remote.example.com] -P [port-number] -u [user-name]
or in alternative notation:
Code:
mysql --host=[remote.example.com] --port=[port-number] --user=[user-name]

Best regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum