Use Field Icons I've Uploaded to a Related App

  • 1
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I've maxed the extent to which I can use the QuickBase icons, and now I want to be able to use other icons, so I've added an Icons table to my QB Admin app, which I want upload icons into and refer to them in other apps.

Do the icons need to be PNG files or will other filetypes work?

I'd like to be able to upload icons of a larger size and then tweak the referring field if I want the image to display as smaller.

What formula should I use in the Icons table to make the icon display?

What formula should I used for fields in related apps to make the icon display as a 16 x 16 image?

Thank you!
Photo of Amber

Amber

  • 590 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
  • 1
Photo of Chris

Chris

  • 4,430 Points 4k badge 2x thumb

Hi,

Use this code as formula text, called [image preview] field with html enabled to capture the URL of the attachment file - or the image:

"<img src="&URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e6/v0/" & [Image]&" width='120px' />"

Above, [Image] is the file attachment field. Notice in the code, we have an HTML attribute of "width="120px".

I hope this helps.


(Edited)
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
Amber,

It can be a png or jpg image.  

And rather than creating an image preview field, then referencing that in your button, you can reference the direct URL, which might speed things up a little.


Just modify the field properties of your file attachment field to be accessible without logging in, and now that file attachment is a permanent link for anybody to see/use


Then you copy the URL into your 'a'frame.  Add your own action URL to the href, and size it as you'd like.

"<a  href='#' title=\"Click Me\" >
<img src=\"https://www.quickbase.com/up/bdvnw2gfi/g/rd/eh/va/busybee2.jpg\"; height=\"32\"></a>"
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
If you want to just display that image, and always have it be static, using the URL is best. 

If you want the image to change and be dynamic based on some other field, you can make a conditional statement to display different images.

But to be able to use the image in a completely different application that doesn't have a relationship, you will want to stick to the URL from the file attachment
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
Its showing the file doesn't exist.  Try simplifying the filename prior to upload.  

I've notices that QB struggles with long, or special characters in the file names.
Photo of Amber

Amber

  • 590 Points 500 badge 2x thumb
I changed to a simple filename:

(If ([Form]="desktop", "<img src=\"https://www.quickbase.com/up/bmkiqjckt/g/rd/eh/va/pc1.png\"; width=\"15\">"),

But I'm getting this error: Your request to download the file pc1.png from the application QB Admininstrator: Icons failed because the specified field was not a File Attachment field.
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
I think we might be copying the wrong URL.  

When you upload the file.  Then click on the attachment, quickbase will open a specific URL for that image.

eg. 
https://cirrusops.quickbase.com/up/bmgd28ku6/g/rb/eg/va/mutton_bustin_bib.jpg
or
https://cirrusops.quickbase.com/up/bmgd28ku6/g/rc/eg/va/Calf_Riding_image.jpg

They will all have a variation of the 'g/rc/eg/va' etc.

Don't copy any codes from this form, but only click on your attachment, and copy that unique URL for that unique image file.

This might be the issue...
Photo of Amber

Amber

  • 590 Points 500 badge 2x thumb
Wow, finally! So sorry -- it seems crazy obvious now. Thank you!