Buy Now
Sign in

input text field VALUE from ReadData database

pachf11 , August 20 2017
Answered
P
pachf11
I can't insert matching instruction in value field. Have field empty or with some html taags. When I write to: {user:id} it shows me number of user id - is ok, when try with function empty - it's ok - return 1. I tryed for many options and don't have idea how use data from read data query. Please help!
admin
Hi pachf11,

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
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!
P
pachf11
Hi 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ł
admin
Hi Pawel,

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
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!
P
pachf11
Great! Now it's function OK. Thank You very much!

Best Regards

Paweł
V
vividal
I am having this same issue and I think I have the syntax correct but my field is still blank. On my form I have a drop down that selects a users name. Then I have an event that reads the data (selecting 1st matching record). According to the debug it is finding the record I expect but it is not populating the next field with the value. Any thoughts on what I have wrong based on the debug and field syntax below:
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?
GreyHead
Hi vividal,
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
V
vividal
Sorry for the confusion. The form has 5 fields (fields 3-5 work fine). Field1 (filmuser_id) is a drop down where I select the a value. It has a reload action on change for element id jmid1. Field 2 (jmid1) has a reload event GetJMID which is where the debug is displayed after loading the value based on the selection from field1.
admin
Hi,
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
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!