Buy Now
Sign in

Populate Table List with Database > SQL Data array

shahabpk , August 26 2021, 10:09
S
shahabpk 96
August 26 2021, 10:09 #396991
I want to populate Table list coloumns with the result of the action SQL Data ( sql_data_2 ). I am able to populate it with read_data action but since my sql query is a little complicated, I want to use the SQL data action. The debug shows that it returns the data to an array correctly. But i don't know how to use that data in Table List and what short code to be used. I know that normal short code is {var:Model.fieldname} . SQL Data action has no Model. So basically the doubt is how to get data from an SQL data array which is not having a model name/alias.?
GreyHead 65
December 09 2021, 17:08 #397543
 Answer
Hi shahabpk,
The Shortcodes Cheatsheet for CFv7 says to use {var:action_name} to return the result value of an action with the name "action_name"
Bob
If you'd like to buy me a coffee or two, thank you very much
S
shahabpk 96
December 10 2021, 04:43 #397547
Thank you GreyHead
I am able to populate contents to Table List when using {var:action_name} as you suggested.
The reason for confusion was the auto suggestion given by the Data Sources dropdown in the Table List settings. It lists there the sql data action we created as form_strat_page - SQL Data 1. Ignore it and use {var:action_name} as GreyHead suggested.
By the way where can i find the CFv7 Shortscodes Cheatsheet?
GreyHead 65
December 10 2021, 16:24 #397561
 1
Hi shahabpk,
When you open a form there is a book icon near the top right hand side - that should give you the Shortcodes Cheatsheet. (You may need to have the form in Advanced mode rather that the simple Contact form mode.)
Bob
If you'd like to buy me a coffee or two, thank you very much
C
Colnem 427
December 10 2021, 17:16 #397563
Hi Greyhead
Have you the same bug that me with CF7 (PHP7, Joomla 3.10, CF7 2.08)?
If I modify one SQL Where conditions, then save, then open my form, SQL Where conditions ara invisible...
I have this bug with the Basic Demo Form (written to Max).
Thanks