Forum Discussion

LesKimbler's avatar
LesKimbler
Qrew Cadet
5 years ago

Formula URL to Open a Pic Attachment field

Hello,

I have multiple project apps that currently use Automations and/or QB actions to copy data from individual apps into a single repository app. But I have now been requested to add the ability to add pictures. It does not appear to be a way to copy a file attachment using automations/actions, so I thought the next best thing would be creating a URL Link in the original app that can then be copied into the single repository app, that can be clicked to open the Pic attachment.

Browsing through the Communities, I've found several ways that show creating some type of link, but nothing i have attempted has been able to get one to open the attachment when you click it. Below is where I'm at at this point.

Here is the formula I got from Communities, and the one adjusted for my app:
if ([Document]>"", "<a href=\"" &URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#]& "/e999\"target=_blank\">" & [Document]& "</a>","")
If ([Part #1 Pic]>"", "<a href=\"" &URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#]& "/e153\"target=_blank\">" & [Part #1 Pic]& "</a>","")

I need a formula that will essentially pull the URL link for the Pic attachment field, to display in the Pic Link Test field, and be able to click it to open the attachment when the link is copied into the repository app.

Any help is greatly appreciated



------------------------------
Les Kimbler
------------------------------
  • It looks like the field type you've selected is Formula URL. If that's the case, you'll want to format your formula a bit differently. The formula that you're currently using is intended to be used in a Formula Rich Text field. The formatting for the URL field would be something like this:

    If ([Part #1 Pic]>"", URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#]& "/e153","")​

    To set the option to open in a new window, you would select this option in the URL field properties of the field you are copying this link to.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------
    • LesKimbler's avatar
      LesKimbler
      Qrew Cadet
      Thanks Blake, I switched the field property to Rich text and it works perfectly.

      ------------------------------
      Les Kimbler
      ------------------------------