Buy Now
Sign in

Modify data

gebonimo , February 04 at 19:59
Answered
G
gebonimo
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 ? ​

admin

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
If your main question got answered then please mark the answer using the button!​

Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gebonimo

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 ?

admin

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
If your main question got answered then please mark the answer using the button!​

Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gebonimo
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 ​
admin
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
If your main question got answered then please mark the answer using the button!​

Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gebonimo

​​
​Array​
​(​
​ [page] => Chronoforms6​
​ [cont] => manager​
​ [chronoform] => modif_mot_unique​
​ [event] => submit​
​ [Model1] => Array​
​ (​
​ [CleEtrMotFrP] => 8​
​ [Traduction] => t​
​ [Contexte] => t​
​ [CleEtrGenreP] => 1​
​ [CleEtrNatureP] => 11​
​ [CleEtrCommune] => 31​
​ [CleEtrCanton] => 1​
​ [CleEtrDefP] =>​
​ )​
​​
​ [button12] => ​
​)​
​​
​Array​
​(​
​ [validate_fields2] => Array​
​ (​
​ [log] => Automatic validation enabled.​
​ [var] => 1​
​ )​
​​
​ [read_data9] => Array​
​ (​
​ [log] => Array​
​ (​
​ [0] => SELECT `Data9`.`CleEtrDef` AS `Data9.CleEtrDef` FROM `t_mot_francais` AS `Data9` WHERE `Data9`.`id` = '8' LIMIT 100;​
​ )​
​​
​ [var] => Array​
​ (​
​ [0] => Array​
​ (​
​ [Data9] => Array​
​ (​
​ [CleEtrDef] => 9​
​ )​
​​
​ )​
​​
​ )​
​​
​ )​
​​
​ [save_data10] => Array​
​ (​
​ [data] => Array​
​ (​
​ [CleEtrMotFrP] => 8​
​ [Traduction] => t​
​ [Contexte] => t​
​ [CleEtrGenreP] => 1​
​ [CleEtrNatureP] => 11​
​ [CleEtrCommune] => 31​
​ [CleEtrCanton] => 1​
​ [CleEtrDefP] =>​
​ )​
​​
​ [_error] => Error saving the data.​
​ [log] => Array​
​ (​
​ [0] => INSERT INTO `t_trad_patois` (`CleEtrMotFrP`, `Traduction`, `Contexte`, `CleEtrGenreP`, `CleEtrNatureP`, `CleEtrCommune`, `CleEtrCanton`, `CleEtrDefP`) values ('8', 't', 't', '1', '11', '31', '1', '');​
​ )​
​​
​ [var] => ​
​ )​
​​
​)​
​​
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​
admin
Hi gebonimo,
In the "Data override on save" of the "Save data", use this:
CleEtrDefP:{var:read_data9.Data9.CleEtrDef}
Best regards
Max
If your main question got answered then please mark the answer using the button!​

Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gebonimo
I did try it, and there is the debugger :

​​
​Array​
​(​
​ [page] => Chronoforms6​
​ [cont] => manager​
​ [chronoform] => modif_mot_unique​
​ [event] => submit​
​ [Model1] => Array​
​ (​
​ [CleEtrMotFrP] => 8​
​ [Traduction] => fgdf​
​ [Contexte] => dfgdfgdsf​
​ [CleEtrGenreP] => 1​
​ [CleEtrNatureP] => 12​
​ [CleEtrCommune] => 273​
​ [CleEtrCanton] => 46​
​ )​
​​
​ [button12] => ​
​)​
​​
​Array​
​(​
​ [validate_fields2] => Array​
​ (​
​ [log] => Automatic validation enabled.​
​ [var] => 1​
​ )​
​​
​ [read_data9] => Array​
​ (​
​ [log] => Array​
​ (​
​ [0] => SELECT `Data9`.`CleEtrDef` AS `Data9.CleEtrDef` FROM `t_mot_francais` AS `Data9` WHERE `Data9`.`id` = '8' LIMIT 100;​
​ )​
​​
​ [var] => Array​
​ (​
​ [0] => Array​
​ (​
​ [Data9] => Array​
​ (​
​ [CleEtrDef] => 9​
​ )​
​​
​ )​
​​
​ )​
​​
​ )​
​​
​ [save_data10] => Array​
​ (​
​ [data] => Array​
​ (​
​ [CleEtrMotFrP] => 8​
​ [Traduction] => fgdf​
​ [Contexte] => dfgdfgdsf​
​ [CleEtrGenreP] => 1​
​ [CleEtrNatureP] => 12​
​ [CleEtrCommune] => 273​
​ [CleEtrCanton] => 46​
​ [CleEtrDefP] => ​
​ )​
​​
​ [_error] => Error saving the data.​
​ [log] => Array​
​ (​
​ [0] => INSERT INTO `t_trad_patois` (`CleEtrMotFrP`, `Traduction`, `Contexte`, `CleEtrGenreP`, `CleEtrNatureP`, `CleEtrCommune`, `CleEtrCanton`, `CleEtrDefP`) values ('8', 'fgdf', 'dfgdfgdsf', '1', '12', '273', '46', '');​
​ )​
​​
​ [var] => ​
​ )​
​​
​)​
​​

​Here my save_data10 :

​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
admin
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
If your main question got answered then please mark the answer using the button!​

Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gebonimo
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 ​