Forums

Use data stored in CF7 datalog

giamas72 09 Jan, 2022
Hello, I'm just started to use CF7, from several year of usage of CF5 into my Joomla 3.x site. My intent is to switch to Joomla 4.x ASAP
I'm trying to use data collected in #__chornog3_form7_datalog to create a list of registred chess players for a specific tournmant.
Here is an example of data stored in 'data' field
{"1":"giam","2":"mas","4":"myemail_address@gmail.com","3":"NC","5":"Torneo1","6":"122412121","__loops":null}

for what I understood, the "datalog" table in CF7 is going to store all data entries in the form I'll create for my site. Because the "from template" will be always the same, I'm guessing if I'm going to be able to pick up from this DB all data I need that contains, for example, "Torneo1", or "Torneo_bullet", or similar, I'll be able to list all players signed for that particular tournament.

Question: how can I pick ONLY data I need from the "big basket" of #__chornog3_form7_datalog ?
I think I need to add a "query fileds" in the action I just created using this video tutorial tha is inchaged to "read" all data in this table, but HOW IT WORKS THIS?
Can you help me?
GreyHead 12 Jan, 2022
Hi giamas72,

The data saved in the log table is saved using JSON encoding to convert the full array of data to a single string. You can convert the string back to an object or an array using json_decode() in a Custom PHP action.

Please see here for some basic examples.

Bob
giamas72 16 Jan, 2022
Thanks GreyHead for your answer, but it's diffucult to me to understand how to move on.
Currently I added in my "Connectivity template" a WHERE CONDITIONS in order to pick up just the data that containts some specific Torunmanet name (fro example "Torneo1").

From your suggestion, I saw example I need to use : $arr = json_decode($jsonobj, true); OK I got it.
But what I need to do now? Do I have to add a "PHP" block in the "found section" of the "actions" is reading the data from DB or what?
Current status is
- I created an actions called "dataLog" that is reading data from #__chornog3_form7_datalog WHERE 'data' value of each record contains "Torneo2"
- I created a view iist in which are inserted aid and data value of each record extraced using previous actions
- 'data' is in Json value but I want to alter the view list in previous point in order to have specif column that will contains datas decode from json format

Please, can you help me with some more detail?
Thanks,
GreyHead 17 Jan, 2022
Hi giamas72,

If you want more flexibility then the simplest solution is probably to create a new table with the structure that you need and save the form data to that table.

Bob
giamas72 19 Jan, 2022
I thought so too and, in fact, with CF5 I was used to doing so. Honestly though, on CF7 I couldn't figure out how to do it. Your component is really complete and powerful, but in terms of manuals and tips, there isn't much on the site and I have to go to you to figure out how.
Sorry for the frankness. I repeat I am really a big fan of yours, but I find the new version very little "user-friendly" for many things.
Can you give me some more direct tips to solve my problem?
Thank you
giamas72 23 Jan, 2022
I really don't have any idea on how to save data in a DB
I just created a bkp file of current form. I really can't solve by myself[file=https://www.liberotorneificioscacchi.it/Chronoforms7_http___localhost_23_Jan_2022_12_47_33.cf7bak]CF7_template_backup[/file]
Can someone help ? Why it's not storing data in the DB file I made?
GreyHead 01 Feb, 2022
Hi Giamas,

These are not my products, I'm just helping out here and I'm afraid that while I knew earlier versions well I am not so experienced with CFv6 or v7 :-(

I think that to create a table you would need to do that using MySQL or possibly the AceSQL Joomla component.

Bob
Colnem 04 Feb, 2022
Hi giamas

Have you a direct acces to your DB servor with PHPMAdmin?
You need to login to be able to post a reply.