Reference an Image with a text field


A true ReTool newbie. I went through the forum and was not able to find an answer. Is it possible to link an image field to a specific text field, as a single field? In this way, whenever the field is used, the associated image would also appear, as part of a single field. This would apply to tables, checklists, headers, drop downs, etc.

Schema Example

ID int(11) NOT NULL,
ProjectType_idProjectType int(11) NOT NULL,
Name varchar(255) NOT NULL,
Description text NULL,
'StartDatedate NULL DEFAULT NULL, EndDate date NULL DEFAULT NULL, PRIMARY KEY (ID), INDEX ProjectType_idProjectType(ProjectType_idProjectType) USING BTREE, CONSTRAINT Project_ibfk_1 FOREIGN KEY (ProjectType_idProjectType) REFERENCES ProjectType (ID`)

ID int(11) NOT NULL,
Name varchar(255) NOT NULL,
ImageURL text NULL,

The ImageURL is an image url.

The ProjectType.ID is a foreign key in the Project table. When the ProjectType.ID is referenced in components using the Project Table, is it possible for the ProjectType.ID to be displayed using the ProjectType.Name, along with the ProjectType.Image URL, as a single field?



@Newbie Welcome to the forum!
What end result are you trying to achieve and can you share some screenshots?

Hi ScottR

I am trying to combine a text and image as one field. Specifically, where the text is the name of a Project Type and the image is the URL of the specific Project Type. Both the ProjectType.Name and ProjectType.Image are stored in the ProjectType table. The Project Type is a foreign key in the Project table.

The Project Type use case is an example that can be applied to any foreign key.

The combined field will be visible in all components (i.e. tables, checklists, drop downs, etc.). Depending on the component, clicking the combined field will allow the user to select the Project Name as the foreign key reference (e.g. in a form component or an inline table editor during an insert or update).

In other situations, clicking on the combined field will navigate the user to a page that lists all the selected Project type details.

Attached are some screenshots.



So you want to add this to a column in a table component or in every component?
What does the data look like when you run the query?
Have you read through the docs?

Hi ScottR,

As a recap.

The data in a query would simply be a query with a foreign key reference.



Not sure you would be able to add this to table component - (there is a new table component in the works that I know of that might be able to get the icon and name within a column) but at this time I can't see it being added in a table.
However, in other places, you may want to use an HTML component
Screenshot 2023-01-31 at 12.58.27 PM