Populate Table List with Database > SQL Data array

shahabpk 26 Aug, 2021
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 09 Dec, 2021
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
shahabpk 10 Dec, 2021
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 10 Dec, 2021
1 Likes
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
Colnem 10 Dec, 2021
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
You need to login to be able to post a reply.