First, the read data must be BEFORE the "display section", then you can use a "Debugger" to display what data is available for usage, the data of any action is available under {var:action_name}, but the exact path is visible in the debug output.
Please check the manual or post the debug results and I can explain how to find the path.
Best regards,
Max
I have readdata on first position, second is display. I used debugger and found interesting me data. This is from the debugger:
Array
(
[language] => pl-PL
[format] => html
[Itemid] => 453
[option] => com_content
[lang] => pl-PL
[view] => article
[id] => 11
[ark_inine_enabled] => 1
[arkoption] => com_content
[com_content.article.-1289027624] => 1
)
Array
(
[read_data9] => Array
(
[log] => Array
(
[0] => SELECT COUNT(`CH_MODEL_USER`.`virtuemart_userinfo_id`) AS `CH_MODEL_USER.count` FROM `joom_virtuemart_userinfos` AS `CH_MODEL_USER` WHERE `CH_MODEL_USER`.`virtuemart_user_id` = '907';
[1] => SELECT `CH_MODEL_USER`.`title` AS `CH_MODEL_USER.title`, `CH_MODEL_USER`.`first_name` AS `CH_MODEL_USER.first_name`, `CH_MODEL_USER`.`last_name` AS `CH_MODEL_USER.last_name` FROM `joom_virtuemart_userinfos` AS `CH_MODEL_USER` WHERE `CH_MODEL_USER`.`virtuemart_user_id` = '907' LIMIT 30;
)
[var] => Array
(
[0] => Array
(
[CH_MODEL_USER] => Array
(
[title] =>
[first_name] => Paweł
[last_name] => Chojaczyk
)
)
)
)
)
END DEBUG
I tryed {data:xxx} and {var:xxx} but couldn't find resolve.
Thank You
Paweł
In order to get the first_name from the data you need to use the following:
{var:read_data9.0.CH_MODEL_USER.first_name}
But if you are planning to load ONE record only then you better set the "Select type" in the "Read data" to "First matching", you can then use:
{var:read_data9.CH_MODEL_USER.first_name}
Best regards,
Max
Best Regards
Paweł
Array
(
[read_data10] => Array
(
[log] => Array
(
[0] => SELECT `JMUSERID`.`aid` AS `JMUSERID.aid`, `JMUSERID`.`jmid` AS `JMUSERID.jmid` FROM `film_vw_users` AS `JMUSERID` WHERE `JMUSERID`.`aid` = '2' LIMIT 100;
)
[var] => Array
(
[JMUSERID] => Array
(
[aid] => 2
[jmid] => 58
)
)
)
)The Value of the field I want to populate is {var:read_data10.JMUSERID.jmid}
I would expect it to be 58 but it remains blank. thoughts?
I'm not clear where these things are happening. Is the read data after the first part of the form (with the drop down) is submitted?
Bob
The syntax of the shortcode is correct, but the read data should be inside the same event of the "reload" and BEFORE the "custom code" action used to render the field.
You may also try to call the shortcode directly from the "custom code" {var:read_data10.JMUSERID.jmid}
Best regards,
Max
Earlear, i tried to use this command into wrong place (in text field of form, but display section function is into success event of read data function) it is the reason could't output the data as i think
Max,
Is this all written above still apply with the latest CF6 update ? I cannot get why I cannot populate text field with the instructions above .
To reload the text field I have a standalone action named load_katUCI with [read_data255] action and custom code with following code inside:
{var:read_data255.model.katUCI}
{view:field_text987}Read function works as expected (see Debug below).However I cannot get the needed data INSIDE THE TEXT FIELD.
Funny thing is that I can get that value to be printed OUTSIDE the text field, as my debug shows🙂 when I enter the following code AFTER the view code. Any ideas?
after texfield view: {var:read_data255.model.katUCI}
http://www.chronoengine.com/forums/posts/t107640/populate-field-value-after-selecting-value-in-dropdown?keywords=dynamically%20populate%20text%20field
- I had an php action code missing.
that is a litle bit weird though🙂 - is this the correct way of doing this, Max?
Thanks!
