Forums

Modify data

gebonimo 04 Feb, 2018
Hi,

I saw the possibility to have a function in the set up menu called "Modify data". I don't find any info or tuto on it while i'm thinking it could be very useful for me.

Do you know where i can find any information on it ?
Max_admin 04 Feb, 2018
Hi gebonimo,
The modify data is used to build a custom data provider, after the modify data is processed you can use {var:modify_data_name} to access the data which was present in the modify data values, so if the data provider to modify data was {data:} and you add this in the data override:
x:y
Then {var:modify_data_name} will have all the {data:} values + x = y
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gebonimo 04 Feb, 2018
In my case i'm trying to modify a hidden field after a read_data.
So i have to put in the data provider {var:read_dataX}
And in the "Data override"
hiddenX:{var:read_data9}
Then in my db_save
Db_field:{var:modify_dataX}
Right ?
Max_admin 06 Feb, 2018
Hi gebonimo,
it depends, what is the select type in your "Read data" ?
But the scenario is correct, this is what you need to do, what is the {var:read_data9} ?
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gebonimo 10 Feb, 2018
The read_data should be an foreign key given by another field in the form (don't know if i'm clear).
​
read_data9 is the read data where i have my data to use into my db save. I can't succeed using the result of my read_data in my db save. So i thought this might be a good solution
Max_admin 10 Feb, 2018
Hi gebonimo,
​
You need to check the values you have with a debugger, and based on that you decide if the modify data is going to be useful, could you please post some debug info and let me know what you need to save exactly ?
​
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gebonimo 10 Feb, 2018
[pre]
[br]Array[br]([br] [page] => Chronoforms6[br] [cont] => manager[br] [chronoform] => modif_mot_unique[br] [event] => submit[br] [Model1] => Array[br] ([br] [CleEtrMotFrP] => 8[br] [Traduction] => t[br] [Contexte] => t[br] [CleEtrGenreP] => 1[br] [CleEtrNatureP] => 11[br] [CleEtrCommune] => 31[br] [CleEtrCanton] => 1[br] [CleEtrDefP] =>[br] )[br][br] [button12] => [br])[br][br]Array[br]([br] [validate_fields2] => Array[br] ([br] [log] => Automatic validation enabled.[br] [var] => 1[br] )[br][br] [read_data9] => Array[br] ([br] [log] => Array[br] ([br] [0] => SELECT `Data9`.`CleEtrDef` AS `Data9.CleEtrDef` FROM `t_mot_francais` AS `Data9` WHERE `Data9`.`id` = '8' LIMIT 100;[br] )[br][br] [var] => Array[br] ([br] [0] => Array[br] ([br] [Data9] => Array[br] ([br] [CleEtrDef] => 9[br] )[br][br] )[br][br] )[br][br] )[br][br] [save_data10] => Array[br] ([br] [data] => Array[br] ([br] [CleEtrMotFrP] => 8[br] [Traduction] => t[br] [Contexte] => t[br] [CleEtrGenreP] => 1[br] [CleEtrNatureP] => 11[br] [CleEtrCommune] => 31[br] [CleEtrCanton] => 1[br] [CleEtrDefP] =>[br] )[br][br] [_error] => Error saving the data.[br] [log] => Array[br] ([br] [0] => INSERT INTO `t_trad_patois` (`CleEtrMotFrP`, `Traduction`, `Contexte`, `CleEtrGenreP`, `CleEtrNatureP`, `CleEtrCommune`, `CleEtrCanton`, `CleEtrDefP`) values ('8', 't', 't', '1', '11', '31', '1', '');[br] )[br][br] [var] => [br] )[br][br])[br][br][/pre]
I would like to save the [CleEtrDef] as [CleEtrDefP], but in my db_save, when i'm trying to save it like this
​
CleEtrDefP:{var:read_data9} it just return me array as value. Not (in this case) 9[br]
Max_admin 11 Feb, 2018
Hi gebonimo,
​
In the "Data override on save" of the "Save data", use this:
CleEtrDefP:{var:read_data9.Data9.CleEtrDef}
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gebonimo 11 Feb, 2018
I did try it, and there is the debugger :
​[pre]

Array
([br] [page] => Chronoforms6[br] [cont] => manager[br] [chronoform] => modif_mot_unique[br] [event] => submit[br] [Model1] => Array[br] ([br] [CleEtrMotFrP] => 8[br] [Traduction] => fgdf[br] [Contexte] => dfgdfgdsf[br] [CleEtrGenreP] => 1[br] [CleEtrNatureP] => 12[br] [CleEtrCommune] => 273[br] [CleEtrCanton] => 46[br] )[br][br] [button12] => [br])[br][br]Array[br]([br] [validate_fields2] => Array[br] ([br] [log] => Automatic validation enabled.[br] [var] => 1[br] )[br][br] [read_data9] => Array[br] ([br] [log] => Array[br] ([br] [0] => SELECT `Data9`.`CleEtrDef` AS `Data9.CleEtrDef` FROM `t_mot_francais` AS `Data9` WHERE `Data9`.`id` = '8' LIMIT 100;[br] )[br][br] [var] => Array[br] ([br] [0] => Array[br] ([br] [Data9] => Array[br] ([br] [CleEtrDef] => 9[br] )[br][br] )[br][br] )[br][br] )[br][br] [save_data10] => Array[br] ([br] [data] => Array[br] ([br] [CleEtrMotFrP] => 8[br] [Traduction] => fgdf[br] [Contexte] => dfgdfgdsf[br] [CleEtrGenreP] => 1[br] [CleEtrNatureP] => 12[br] [CleEtrCommune] => 273[br] [CleEtrCanton] => 46[br] [CleEtrDefP] => [br] )[br][br] [_error] => Error saving the data.[br] [log] => Array[br] ([br] [0] => INSERT INTO `t_trad_patois` (`CleEtrMotFrP`, `Traduction`, `Contexte`, `CleEtrGenreP`, `CleEtrNatureP`, `CleEtrCommune`, `CleEtrCanton`, `CleEtrDefP`) values ('8', 'fgdf', 'dfgdfgdsf', '1', '12', '273', '46', '');[br] )[br][br] [var] => [br] )[br][br])[br][br][/pre]
[br]Here my save_data10 :
​
[br]Don't understand why it is not working... That's why i was thinking about the hidden field. I'm searching a solution since 3 daysπŸ˜€ [br]
Max_admin 11 Feb, 2018
Answer
Your read data returns multiple results, so a 0 must be added BEFORE the Data9:
CleEtrDefP:{var:read_data9.0.Data9.CleEtrDef}
OR, set the "Select type" in the "Read data" to "First matching" and do not change anything else.πŸ™‚
​
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gebonimo 11 Feb, 2018
1 Likes
Doesnt work with both solutions. I did change the select type but still no data

​
EDIT my bad it worked i missed a . Thanks a lot
This topic is locked and no more replies can be posted.