Could someone shed some light on the best practice for the following;
I have a read only table of category, type, image i am using as a reference table. The Garment column is a key/label and the image column is a label. It looks like the below
[Department] [Garment] [Images]
Outerwear Rainwear Garment_images/Rainwear.png
The referencing works fine, the image and label show up in my drop down lists.
But I am also trying to use an app formula to find the associated image column as an the main image for my Order Details page.
I was using a spreadsheet formula which was working but only after the sync occurred, pretty sure i can just create a VC in my order details page as show image type? or image type? I have tried a few formulas but cant seem to get the image to showโฆ
Thanks for reading
Solved! Go to Solution.
You need a column (real or virtual) of Image type in the child Table. Set itโs App Formula to
[whatever your parent ID is].[image column]
Then you can set it in views.
EDIT: virtual is probably best if it is possible to change the parent image and you want any and all children to also reference new image.
HI Steve,
I didnโt explain myself to well there,
When i create a child record for an order, this child record is a โproductโ type record that allows the user to select the โgarmentโ type, so thats working fine by referencing the โgarmentโ table that has text and image as labels. But i also want to set this child recordโs main image as the same one that is being referenced
I have a folder named Garment_images within the same folder that has my spreadsheet on Gdrive.
I have the spreadsheet tab for the child records that has an image column, inside the image column cells i have the image file name value as per your link. ie: Garment_images/Tshirt.png
So far i have been using an array-formula in this image column in the child record spreadsheet, the array-formula just finds the Garment type and concatenates the file name value to build the correct value, obviously this is not ideal as the app cannot see that cell and hence display the image until it syncs the child record.
Im thinking there is a better way of doing this by using an appformula so that i can have the garment image show up immediately
I cant set the Image column to a Ref type, because the inline details view will not display ref as an image,
If i use a spreadsheet formula the app doesnโt recognize the image until after a sync,
I cant use a appsheet formula such as SELECT as that seems to want to find values and they donโt return as an image,
There should be a way of doing this as the app can already see these images in the referenced table, any other ideas?
You need a column (real or virtual) of Image type in the child Table. Set itโs App Formula to
[whatever your parent ID is].[image column]
Then you can set it in views.
EDIT: virtual is probably best if it is possible to change the parent image and you want any and all children to also reference new image.
Do you have an example of this? If I have a Parent Table called Main_Table with the following columns: uniqueID, Name, image. The child Table is called Photos_Table with the followinng columns: PhotoID, Photo.
Following your instructions:
[whatever your parent ID is].[image column]
If I enter the following expression into the child table Photos_Table image column: [uniqueID].[image]
I get the following error:
Unable to find column โuniqueIDโ, did you mean โPhotosIDโ?
I am pretty new to Appsheet and my goal is to store all the images into the child table and reference them into the parent table to be viewable in the cards or deck view. Unfortunately, as the original poster mentioned, โI canโt set the Image column to a Ref type, because the inline details view will not display ref as an image,โ which is I assume the reason why my image ref type does not load in the card compared to using a a standard image Type.
Do you have a step by step that I can follow?
It sounds like you first need to learn more about how references work:
Thanks for the link. I read that as well as the links within the article. I am starting to familiarize myself with references but I am still trying to wrap my head around your syntax. I understand that once you create a ref from the parent to the child, that appsheet auto creates a hidden column called modified main_table with the expression REF_ROWS(โMain_Tableโ, โImageโ).
Is this what you are referring to?
My main problem is that when the parent references the child image column, the image within the parent Main_Table card disappears. If I donโt use a ref type, the image type works fine and shows up in the cards, as expected. However, I want to pull the images from the Photo Table. I just donโt understand why a ref type cannot be displayed as an image? I was hoping your expression would help that problem.
Any ideas?
Not hidden, and โRelatedโฆโ not โmodifiedโ.
I wasnโt referring to anything. I just thought you needed more knowledge about references based on what you wrote earlier.
Itโs still not clear exactly what youโre doing. For further help, Iโd suggest attaching screenshots of your setup.
Here is the table data. I did notice that for the โNew Listโ viewer uses โPhotoโ for main image while the Main_Table parent vieweruses โAutoโ but does not have any other options other than โnoneโ. I am assuming that this is beacuse it cannot read the data from the reference?
In your case, the [whatever your parent ID is] is currently your [Image] column.
Therefore, I should enter the following expression into the child table Photos_Table image column: [image].[image]
I still get an error. Should I be using REF_ROWS? What is the correct syntax for my case? Thanks
Main_Table is your โchildโ Table in this case.
Now thats confusing. I thought that since the photos are located within the Photos_Table, that Main_Table would ref to Photos?
Where would the expression go then and what would that expression be?
Would you be so kind as to write a step by step for me as I have been working on this for the past 3 days. Thanks in advance.
Typically, we call the Table with the Ref type column the โchildโ, and the Table with the REF_ROWS() VC the โparentโ.
To translate the above for your situation:
You need a VC in Main_Table, with the expression:
[Image].[Photo]
Wow. That actually works. Thank you so much!!!
To summarize,
Here are the steps to make this work based on your direction:
a) I have two tables: Main_Table & Photo_Table, where Photo_Table contains all the images.
b) In Main_Table, the โImageโ column or record, is set to REF. The REF is connected to Photo_Table Photo.
c) In Main_Table, a Virtual Column (VC) is created and set to type image. Inside the Formula is an expression containing: [Image].[Photo]
BEFORE:
SETUP:
RESULT:
Google Sheet Data:
Table_Main Sheet:
Photo_Table Sheet:
Works!
In another post, someone recommended turning ON โLabelโ. Why would this be a recommendation?
I am certainly glad this works, However, I am curious as to why a direct ref would not see an image? The fact that you have to use a Virtual Column as a middleman to call the images is confusing especially since referencing all other non-image data does not need a VC.
The Row Label is what is shown in the app for a referenced record, instead of the recordโs key value. Setting the image as the label would allow the user to see the image from the Main_Table Detail view, but that still doesnโt make it available as an image to select in the Deck view of Main_Table. Any column settings in a UX have to be columns in the actual Table.
A reference, at its simplest, is the key value of one record being held in a column of another record. There is no โseeingโ of anything. Your statement of โsince referencing all other non-image data does not need a VCโ is wrong.
Main_Table is not referenced by anything, so setting itโs Row Label isnโt accomplishing anything here. And the reason it would default back to OFF is probably because you already had a column set as the Label, youโd need to turn it off at the same time as turning another one on.
Very informative responses. Thank you for your time. I have learned a great deal from you.
Thats the one!, I was dereferencing it using the wrong key, thanks so much
Essentially, Main_Table is trying to reproduce what you see in the โNew Viewโ but with referenced images. But the ref images just dont show up. I checked to make sure that the image folders exist.
It Looks like when I turn Label ON for Photo within Photo_Table, it displays the photos instead of just the names. That is nice.
BEFORE:
AFTER:
If I try to turn Label ON for Image within Main_Table and save, it defaults back to OFF. I guess maybe because of the virtual column?
User | Count |
---|---|
35 | |
30 | |
30 | |
20 | |
18 |