Automatically generate images URL

Cabelo
Participant V

Hello there,

I have a column on my financial app for receipt images. On the excel sheet the data on that column is shown as the file name (generated by appsheet) and I would prefer if it was the link.

From all I have read, I created a new “image” type column and on “Auto Compute” there is a field called “Spreadsheet formula” and that is where I have been trying to creat a formula for that.
The table is in dropbox and that is also where the images taken by the app end up as well.
I would like some help to learn how to get that formula right, I am doing it based on the sample app called “images in sheets” but I think I am on the wrong path.

Thank you!

1 31 11.3K
  • UX
31 REPLIES 31

With the normal column it won’t work when you are adding the record. If you open and save it, the link will be correct.

=CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=",“AppName-AccountID”,"&tableName=",“Table...”,[ImageColumn])

If you add this into the virtual column and the column type is URL, it will generate the link.

Aleksi, you might think about “pin” your answer to show up on the top, as many people asking for this quite a lot.

Better:

CONCATENATE(
  "https://www.appsheet.com/template/gettablefileurl?appName=",
  ENCODEURL(“AppName-AccountID”),
  "&tableName=",
  ENCODEURL(“TableName”),
  "&fileName=",
  ENCODEURL([ImageColumn])
)

You are a star, as always.
Now it is a time for me to go to bed.

For this approach, make sure to disable “Required Image and File URL Signing” under Security > options if you plans to share those images outside of your organization.

En este escenario me gustaría hacer una pregunta:

¿Como puedo hacer que se genere automáticamente el HIPERVINCULO en Google Sheets, sin tener que entrar de nuevo al registro de Appsheet, ya que el nombre del archivo se genera al guardarlo y en Google Sheets el enlace generado no "captura" el nombre del archivo? Es decir que tengo que editar el registro de nuevo para que incluya el nombre del archivo en el HIPERENLACE.

So soon?

Exactly now.

Cabelo
Participant V

Thanks @Aleksi, @Steve and @tsuji_koichi

I managed to make it work on the virtual column. On the regular column, it creates the link but the link is broken as @Aleksi had already said it was going to happen. I oepend and saved the excel sheet and that did nothing to the link, it still give sme an error, is it really the file that was supposed to be open and saved?

Question 2: Is there anyway that it would generate a dropbox link instead?

If you create Appsheet account using your dropbox account IDs, then it could be possible

I believe that’s (Dropbox link) not possible through your app.

Cabelo
Participant V

Yes yes yes @Aleksi
How did you do that?

Unfortunately it was just a sample what you are looking for which is not possible because it’s generated when the image is downloaded.

@Aleksi thanks man! The reality of what the link really says is just “cosmetics” right? Will the appsheet link for the image be active for as long as the image exists there? Will anyone who has that link have access to the image despite of having a appsheet account or not?

Correct. If you want to show that link, you would need to open your Dropbox account and copy & paste that unique link to your record. Then your user can use that link as long as you have that link in your record. If you manually delete that image, the link will generate an error. The ink is not controlled by the app itself, meaning you control the image from your Dropbox account because it’s a direct link to your image.

Cabelo
Participant V

Thanks @Aleksi.
And if I use the appsheet link, can I share the link with anyone who has access to it via the table source? Does it expire?

If you don’t delete the image, link doesn’t expire.

Nick_Neumann
Participant IV

I’m trying to apply this technique to images linked from a folder path from a one drive account but it doesn’t seem to be working.

But, I noticed that if you open an image and right click and “Open Image in New Tab”, the image opens with a a URL of:

https://www.appsheet.com/get/?i=YXBwTmFtZT1Db250ZW50Q3JlYXRpb24tMTI4MjgxMiZ0YWJsZU5hbWU9UG9zdHMmZmls...

How is this URL generated? Is there a way to make a formula that generates this URL?

@Nick_Neumann
Hej, i am not expert, but i accidentaly got it to work by using:
ENCODEURL(SUBSTITUTE([Column that has image name]; " "; “%20”)) .

The content of the column has to be the pathFolderInGoogleDrive/imageName as example:
People_Images/person1.png

khuslid
Participant V

Struggeling a bit in my WF template with the URL of my images.
I got the URL to work, and link to be active in template (Google docs), but if the URL is empty, it still comes up in my template with: {“Url”:"",“LinkText”:""} and a link to “Bad Request”.
Also it writes out of the table…
Any idea how to hide a empty link? I tried with:
IFS(ISNOTBLANK([Bilde1]),
CONCATENATE(
https://www.appsheet.com/template/gettablefileurl?appName=”,
ENCODEURL(“EntreprenorPRO-1506712”),
“&tableName=”,
ENCODEURL(“dbo.Fdv”),
“&fileName=”,
ENCODEURL([Bilde1])
))
But this only works (hides it) if TYPE is not URL.

And any tip on how to fix the size of the cell in the google docs table?
(As you can see I tried TEXT-type in Bilde2_url, then it hides if empty…)


Ahh. Of course. Put the IF expression in the template. I’ll do that:)

But is it possible to display the URL as “Image1” in the PDF from the template (instead of the full link adress), and still have it as a active link?

You might want to try TEXT([Image]). Then it will generate a directly URL for your image.


There’s a catch if you want to store the image URL like above example. When you create an item, the image URL won’t be populated because the file is not uploaded yet. You will have to refresh (make some change in the row) to set the URL.
However, if you don’t have to store the URL, the virtual column works perfectly.

Perfect! This is only to be used in a WF template, so this shold be perfect!
I’ll try it out…

Created a tip and trick post for future reference.

Does anybody sees what I did wrong? I am learning to construct URL to file , and I have a test pdf file in the default data folder in Gdrive. Of course I get a bad request.

My VC is :
CONCATENATE(
https://www.appsheet.com/template/gettablefileurl?appName=”,
ENCODEURL(“Administrativ-1042873”),
“&fileName=”,
ENCODEURL(“raport.pdf”)
)

in browser link with a bad request result is :
https://www.appsheet.com/template/gettablefileurl?appName=Administrativ-1042873&fileName=raport.pdf

I,ve read https://help.appsheet.com/en/articles/2744751-email-attachment-file-archiving and I disabled that sequrity option for files

Thank you

Missing: “&tableName=”, ENCODEURL(“TableName”), ??

I am trying to create an image URL
=SUBSTITUTE(CONCATENATE(“https://www.appsheet.com/template/gettablefileurl?appName=",EncodeURL(“Siaa-1468672”),"&tableName=”, EncodeURL(“Sample”),"&fileName=",EncodeURL(M2)), " ", “%20”)

But I am getting bad request? Is there any security feature which we have to allow? Or it there any issue with the way I am writing…

Image Column is “M”

hello! how are they?

TO CONSIDER:
app name: test
tables to use:
pdf_files
- pdf_id (text, KEY)
- path (file)
- file (text)
and orders
-order_id(text,KEY)
- customer_name (text)
- client_cell (phone)
- url_pdf(text)
- _pdf_url(url, VIRTUAL COLUMN)

------

I have an app that creates the pdf file and also its url which then stores it in a column in the table. (url_pdf)

Generate an action to be able to view the pdf (view pdf url), referencing the pdf_url and it works like a charm!

The url that opens is the following:
https://www.appsheet.com/template/gettablefileurl?appName=test&tableName=pdf_filesf&fileName=custome...

-------

Now, generate an action to be able to share the pdf by WhatsApp, with plain text, like:

CONCATENATE(
"https://api.whatsapp.com/send?phone=%2B598",
[client_cell],
"&text=%0A%0A*Link to pdf:* ",
[url_pdf]
)

Now I have 2 problems (maybe more):

1. When you share it on WhatsApp, you only pass this url:
https://www.appsheet.com/template/gettablefileurl?appName=test

2. If I copy and paste the following url, which was taken after using the view url action (https://www.appsheet.com/template/gettablefileurl?appName=test&tableName=pdf_files&fileName=customer...) in the browser ( incongnito mode, since the idea is for someone else to open it) it does not show the pdf. It just gives me a blank screen.

Data:

1. Require Image and File URL Signing is OFF

2- The pdf is saved in Google Drive in a folder called pdf_files which was added to the app as a table.

3. A virtual column (_pdf_url) was generated in the "orders" table where the url to be created is concatenated:

CONCATENATE(
"https://www.appsheet.com/template/gettablefileurl",
"?appName=", ENCODEURL("test"),
"&tableName=", ENCODEURL("pdf_files"),
"&fileName=", ENCODEURL(CONCATENATE([customer_name]".pdf"))
)

4. Once the bot starts running, after creating the pdf, it passes the value of _pdf_url to url_pdf

I hope you can help me, I look forward to your comments!

From already thank you very much!

translated by Google

Top Labels in this Space