Forums

Short notes on what 'Query Fields' is inside Read Data Advanced Option

shahabpk 07 Jan, 2021
Hi
  1. Can anyone please explain in short what actually is this Query Fields option given inside the Read data action advanced option? The available help text only says Add Query fields and Functions but nothing in details
  2. Also is it possible to use direct custom SQL query string instead of the settings of read data ? Because my query text has complex join statement.
Max_admin 10 Jan, 2021
Answer
1- for things like COUNT(Article.id) and provide the alias
2- There is a new SQL data action to use your own SQL code!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
BobN 15 Dec, 2022
1 Likes
Ah, ha! I figured it out. You can use it to create columns using MySQL syntax.

I wanted to toggle an icon in my Photo column. Click on the icon and the Flickr page opens up.

I added an HTML Custom widget into my Table List like this into my Photo column:

<a href="{var:GS.PhotoPageURL}" target="_blank" rel="noopener">
{var:GS.PhotoGIF}
</a>


The photo icon appears if there is a link to my Flickr page in the database.

The Query Field for PhotoGIF is then:

If(length(GS.PhotoPageURL)>0,'<img style="border: 0px solid; width: 20px; height: 10px;" src="/gravesearch/images/camera_icon.gif" alt="Photo" />','')
You need to login to be able to post a reply.