Take image from image column and display as link

Hey Everyone,

Simple request… Just cant seem to get it to work,

User take images in app, Image is displayed. All good.
Now also need capability to go to image link. for image download etc, various other stuff. idk

Setup a virtual column called [Image Link]
Trying to set the formula as [Image] to copy from my image column. This obviously doesn’t work. So I now have it as ENCODEURL([Image])

The link doesn’t seem to open. Thinking I need to Encapsulate this expression with some other stuff, but cant figure out what. Images are all hosted in google drive

Thanks guys,

Solved Solved
0 38 8,619
1 ACCEPTED SOLUTION

So, It’s further down in the help article that I sent you…

Format:

=CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" AppName-Account# “), “&tableName=”, ENCODEURL(” TableName "), “&fileName=”, ENCODEURL(+ ImageColumnCell ))

Sample:

=CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" Inventory-114348 “), “&tableName=”, ENCODEURL(” Orders "), “&fileName=”, ENCODEURL(+ B2 )))

To find the application name to include in the image URL, look at the URL bar of the app editor browser window. It should contain something like "https://www.appsheet.com/Template/AppDef?appName=Inventory-114348". The application name is the value following “?appName=”. In this case, the application name is “Inventory-114348”.

To find the table name to include in the image URL, do this:

  1. In the app editor, go to the Data > Tables pane.
  2. Expand the table that contains the image field.
  3. Copy the value in the Table Name property.

To test the image URL, copy the constructed value into any browser window. The image should render. If there is something wrong with the image URL construction, the image will not render and instead you will see a message indicating that the page could not be found. Almost always, this is because the application name specified is incorrectly.

Now that you have the correct image URL, you can embed the image inline within your Google spreadsheet. To do so, add another column (you could call it Image Preview for example), and then wrap the image URL in an IMAGE() expression.

Format:

=IMAGE(CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" AppName-Account# “), “&tableName=”, ENCODEURL” TableName "), “&fileName=”, ENCODEURL(+ ImageColumnCell )))

Sample:

=IMAGE(CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" Inventory-114348 "), “&tableName=”, ENCODEURL( “Orders”) , “&fileName=”, ENCODEURL(+ B2 )))

View solution in original post

38 REPLIES 38

You need to create the getablefile link… It’s down a bit…

Yes but im wondering how to get the file id as the image itself was taken in the app.

It’s always the same concatenation, you can recreate it. I think it’s the key, image column, and some form of datetime…

Sorry man, I’m not seeing the connection. In my spreadsheet I’m just seeing the file location, not the file ID or anything. Is there a standard expression for this or everyone does it different? Not sure where to start.

I don’t take in-app pictures, so I don’t completely follow information regarding it, but as @Grant_Stead said, it should be easily recreatable. I would go to the folder where all these images are being stored and look at their filenames. As you analyze those, they should start to line up with some form of what Grant said. That should help you get the full path.

Im sorry I have been doing that but im not seeing any relation between the file name and the File ID at all.

Sorry, I can’t provide additional help in regards to this one. All the images I use are named images that I pre-uploaded. So I know the exact URL for them.

Hopefully someone else has had the same issue.

I don’t think I understand EXACTLY what you’re trying to do?

So user take images of the delivery slip in our receiving app.
I have others who need to be able to download and print this image.

Can’t they just select the image to open it, then right click to save it?

I think the quality still goes down little even though I have it set to full image quality upload. Was thinking with a link going to the original image would be better quality. Correct me if I’m wrong, as this doesn’t seem to be an issue other have encountered

The main issue here that you need to work around is that the way google drive stores the images, is that even if you you have the folder shared, public, it’s very hard to have the “Public Link” to the actual image from google drive… So around here, we typically can get a strange work around to a public link, based on that concatenated getablefile url…

Have you tried creating the getable file url to see if that works?

What is a getable file URL?

You see the problem is somehow I need to get the file ID for any of this to work. Once I can get that someone with app sheet, I’m good.

Ah, I did not notice the detail of Google Drive. Unfortunately, there is currently no known way to determine the File ID that Drive produces for sharing the file, outside of going into Drive and sharing it from there. Now that Google owns AppSheet, it is possible we eventually get that functionality. But for now, there is no way to get that URL programmatically.

So, It’s further down in the help article that I sent you…

Format:

=CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" AppName-Account# “), “&tableName=”, ENCODEURL(” TableName "), “&fileName=”, ENCODEURL(+ ImageColumnCell ))

Sample:

=CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" Inventory-114348 “), “&tableName=”, ENCODEURL(” Orders "), “&fileName=”, ENCODEURL(+ B2 )))

To find the application name to include in the image URL, look at the URL bar of the app editor browser window. It should contain something like "https://www.appsheet.com/Template/AppDef?appName=Inventory-114348". The application name is the value following “?appName=”. In this case, the application name is “Inventory-114348”.

To find the table name to include in the image URL, do this:

  1. In the app editor, go to the Data > Tables pane.
  2. Expand the table that contains the image field.
  3. Copy the value in the Table Name property.

To test the image URL, copy the constructed value into any browser window. The image should render. If there is something wrong with the image URL construction, the image will not render and instead you will see a message indicating that the page could not be found. Almost always, this is because the application name specified is incorrectly.

Now that you have the correct image URL, you can embed the image inline within your Google spreadsheet. To do so, add another column (you could call it Image Preview for example), and then wrap the image URL in an IMAGE() expression.

Format:

=IMAGE(CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" AppName-Account# “), “&tableName=”, ENCODEURL” TableName "), “&fileName=”, ENCODEURL(+ ImageColumnCell )))

Sample:

=IMAGE(CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=”, ENCODEURL(" Inventory-114348 "), “&tableName=”, ENCODEURL( “Orders”) , “&fileName=”, ENCODEURL(+ B2 )))

Ok, I will work through this. Thank you. Will get back to you on this tomorrow.

Hi I know I came here latelly, but any advice for me ?

I have read everything and I’m not getting the Filename data:

ENCODEURL([image-or-file-column])

This is not working for me, (If I put it manually, It work perfectlly, but is not getting Image info

This is my Code
CONCATENATE(
https://www.appsheet.com/template/gettablefileurl”,
“?appName=”, ENCODEURL(CONTEXT(“AppName”)),
“&tableName=”, ENCODEURL(CONTEXT(“Table”)),
“&fileName=”, ENCODEURL([Evidencia])
)

And The column [Evidencia] Is an image type column

Where are you trying to put this expression?

I Tried on Appsheet and on google sheets

That expression will not work in Google Sheets; it will only work in AppSheet.

But At this moment I only have it on Appsheet, And it’s not working either.

This is the formula that I have on Appsheet:

IF(ISBLANK([Evidencia]),"",
CONCATENATE(
https://www.appsheet.com/template/gettablefileurl”,
“?appName=”, ENCODEURL(CONTEXT(“AppName”)),
“&tableName=”, ENCODEURL(CONTEXT(“Table”)),
“&fileName=”, ENCODEURL([Evidencia])
)
)

Where the Column [Evidencia] is a Image column type.

But when I checked on google sheets it only shows me:

" https://www.appsheet.com/template/gettablefileurl?appName=InspecciónDiversificados-1643914&tableName..."

It is missing the Filename… part

How does this column get its value?

By taking a picture

The image file name is not stored in the column until a sync occurs.

See How Image Capture Works here:

So, what should I do here ?

Make the column that contains the link a virtual column,

And if I need to save the URL on my database ? Should I have a column = [virtual Column], no it won´t work due to a virtual column cant be taken on a regular column, so I don’t know how to storage that value in my database.

If you need the link saved, you must use a normal, non-virtual column. Put the expression in that column’s App formula. Hopefully, when the Image column’s value gets updated with the final image file name, the normal row update process will occur, including the recalculation of App formula expressions. I say “hopefully” because this isn’t something I’ve ever done, so I have to speculate. Give it a try and let us know!

I Used a non-virtual column before I tried with the virtual column and that’s how it didn´t work. So I guess is not possible…

I am trying to reach the same solution as you Juan. I found a side solution that worked for the time being was to change a setting under the “update behavior” setting. I selected “reset on edit?” to true. After this, my users would use the app to take an image, save it. They would then hit edit and save a second time. I think the app formula is running concurrently as the app is writing the location in the Image column and causing a problem. I am now searching for a way to have the appformula run in the back end without having to hit edit and save the second time.

If you still need the solution:

You need to create a bot.

When a new row is added, run this proccess:
- Run a data action
- Set Row Values
- Set these columns: Chosose the columns where you want the URL to appears.

With this formula: 

CONCATENATE(
"https://www.appsheet.com/image/getimageurl",
"?appName=", ENCODEURL(CONTEXT("AppName")),
"&tableName=", ENCODEURL(CONTEXT("Table")),
"&fileName=", ENCODEURL([PictureColumn)
)

Thats really helpful. I have a question. When i try the same to generate QR code to the URL. I only get URL till app name. I tried in many different ways.

Example: http://api.qrserver.com/v1/create-qr-code/?color=000000&bgcolor=FFFFFF&data=https://www.appsheet.com...

app is generating this link inside app. But the qr code only returning this much only
https://www.appsheet.com/start/22b90dde-5d9f-49cf-a99e-12f121dfc210. Why is that happening ? any idea ? It would be really helpful. Thanks in advance.

I display the image link by using bot, if this is exactly what you want.

bmpoweravn_0-1689142588935.png

 

Closing this Thread. I was such a noob at that time. Still am but not like this.

I have solved my issue. Thank you.

sen
Bronze 2
Bronze 2

Any solution yet?

These days you can add a Google Drive Folder as a table inside AppSheet. This way you can "connect to files within a Google folder. AppSheet will provide a table with the folder contents and file metadata to use within your application." See here how-to.

This means you will have access to file IDs and can quite easily generate URLs by looking up the file name and returning the file ID.

Another way would be to create a Bot that generates a URL after a picture is saved (already mentioned above).

If you use an external Database (eg. MySQL, SQL server) you could also offload this by computing the value of the column by applying a formula on the database column such as (for SQL server): 

('https://www.appsheet.com/image/getimageurl?appName=SIS10-cloud-912852&tableName=student&fileName='+[YourImageColumnName]) 

Top Labels in this Space