Newby question/query
I’m attempting to select a column to display as part of an if-then-else… the problem I am facing is that the selectable ‘folders’ within Glide do not contain the column type I am needing to select.
In regards to ‘folders’ I am referring to the black folder icons as displayed in the attached screen shot. Are the folder icon simply referencing sub columns within a data sheet and if so… how do you add a column/sub-column to the ‘folder’ so it can be linked ?
Any columns that are selectable will automatically appear. Most likely the column you’re looking for isn’t a type that can be used in a Template. For example, relations, queries, arrays cannot be referenced in Templates.
Hi Darren, thanks for the info. Can Look Up be used in Templates ?
Yes, but only if the lookup is via a single relation.
A lookup that targets a multiple relation, query or whole table will return an array, which cannot be used in a template.
General rule of thumb: if you see “bubbles” in the data editor column, then you have an array.
1 Like
Can an image be used in a Template ?
IE I have an if-then-else with 1 of 2 outcomes (complete & incomplete)
I want to add the if-then-else outcome to a Template but this can not be done.
So is it possible to create a new Template column or similar that will display one of two images based on the if-then-else outcome ?
I believe it is possible to create a new Template column in the data editor and in the template column configuration enter desired text with placeholders.
When selecting what to replace the placeholders with, choose the if-then-else column.
In theory the Template column will automatically use the output from the if-then-else column
*Please note the above is based on what I have gleaned from the Glide AI help.
So in short, can images be used as part of an if-then-else or is there a way that I can display 1 of 2 images based on the if-then-else outcome within a Template ?
Yes.
That should work. Can you show me an example of where it isn’t working?
Yes. The if-then-else just needs to return the appropriate image URL (which is different to what you mentioned above)
Again, yes.
I’m just trying to create it now.
IN a nutshell I am basically trying to replicate a column that already exists in a different Data Sheet which utilises the if-then-else to produce complete or incomplete. Unfortunately the Group By that I want to use to display the results is within a different data sheet.
To further explain, front end currently displays training completed for each yearly quarter (with a number of totals)
In the image above the training content is displayed using ITEMS DATA
The bold Q2 2024 (6.5 Hours Structured, 6.5 Hours Total) is displayed via the Options panel utilising Group By
Expanding the Group By highlights that it is a Summary via Template
So, what I am hoping to achieve is to have the if-then-else outcome appear on the end of the summary.
The if-then-else returns one of two outcomes. Complete or Incomplete.
For the time being I’d be Happy to have that appear at the end of the BOLD content (Q2 2024 (6.5 Hours Structured, 6.5 Hours Total [COMPLETE]
Ultimately I would like to have the two values (complete and incomplete_) appears as images
I’m afraid I’m having difficulty following, because you seem to be jumping around a bit.
Let me just clarify one point - when you refer to templates, are you referring to Template columns inside the Data Editor, or inline templating in the Layout Editor?
Hi Darren,
Hopefully this helps:
The Template Summary provides the data for the Summary (Selector) - display
Okay, I think I follow now.
Is the if-then-else column in the same table?
If yes, can you not just expand the template definition to include it?
If no, can you replicate the if-then-else logic in the table to replicate it? Or perhaps relate each row to the other table and then bring it in via a lookup?
I can bring it in via look up BUT then I do not know how to make the column available/selectable to a Template Configuration…
Just make sure your lookup is via a single relation, then it should be available.
Hi Darren, appreciate your input and assistance.
Sadly I’m still scratching my head on this one.
I have created a new Look Up Column in the table → Status/Display
I am attempting to include the Status/Display in the Template immediately to its left
Unfortunately I can not locate the Display column as selectable from within the Template configuration (Replacements)
The Status (black folder icon) simply does not appear anywhere throughout the selectable tree
What am I missing here ?
Your lookup column is returning an array, that’s why you can’t use it. Can you show me how it is configured?
Your lookup is targeting a whole table, which is why it is returning an array.
As I’ve already mentioned, you need a Lookup via a Single Relation.
Apologies for the confusion and misunderstanding at this end. Isn’t the relation pointing to a single column within the Training Status Data Table ?
Yes, and it’s returning all rows in that column as an array.
A single column is not a single relation.
I was able to get the desired outcome in a seperate Data Table as shown below:
IE the Template (Summary) includes the Training Status (Complete or Incomplete for the period)
The Template Column (Incompleted) calls the Display column to its left
It is ‘incorporated’ into the Template (Summary) Column via the bottom Replacement {{status}}
I known I can simply recreate the Display Column (if-then-else) within the user table and create an identical Template (Incompleted) Column for the same outcome… but I am looking for a way to utilise what is already there in the Training Status Table and not create new Columns that do exactly what is already there IE a replication
Apologies once again if I am missing something basic, this is all very new to me as I am attempting to identify errors and troubleshoot an app that was built by someone else with no guide or architecture outline provided
Please, no offence meant but I have told you at least 3 times now what the problem is, and you seem to be ignoring my answers.
Once more…
- Your lookup cannot be used in the template, because it is returning an array
- You can tell it is an array because of the presence of the “bubbles”
- The reason it is returning an array is because it is configured to return every value in every row in the target column in the Training Status table
- To fix this, you need to create a single relation between the two tables, then reconfigure your lookup to fetch the display value via that relation.
I’m not sure what else I can say to try and make it clearer? 