Displaying Images in Calculation Field

Comments

9 comments

  • Rainer Grabowski (FVM)

    Hi Jemma,

    you need to use markdown syntax for displaying an image.

    var imgThree = '![type 3 image](/path/to/img.jpg "Optional title")';
    var psst = @Product Safety Status Type;
    
    psst == 'Type 3' ? imgThree : ""
    

    The text in the square brackets can be any alt txt (which is displayed if teh image can't be shown. "(/path/to/img.jpg )" could be a path to a local file, to an image file uploaded to Podio or to any other image in the Internet - as long as all users of this workspace have access to the file (if they don't have access they don't see it.

    So best way is to upload the file to the workspace and take the Podio URL for this file like https://files.podio.com/123456789). Create a new calculation field if you want to try the code above cause it must be a text type calculation field.

    Rainer

    0
    Comment actions Permalink
  • Jemma Tansley

    Hi Rainer, thanks for your reply.

    I have tried what you specified, but i am now getting a Script syntax error: "Unexpected token ILLEGAL"

    Any ideas why?

    0
    Comment actions Permalink
  • Jemma Tansley

    Nevermind, i seemed to have found the problem! Thank you very much!

    0
    Comment actions Permalink
  • Mike Adams

    HI Rainer (and Jemma)
    This is an excellent way to manage images in apps.
    I used your code Rainer to make a calculation that displays an image based on a condition. However if I try to display that Image in a related app using @All of Image I get "unsupported data type". I've set the datatype as text in the first calculation as per your instructions

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    Hi Mike,

    you already have the image in a calculation field and want this calculation field "Image" be shown too in another related app?

    If so you have to make a relation to the first calculation field "Image" in the other app:
    @All of NameOfTheCalculationFieldWhereImageIsIn

    Rainer

    0
    Comment actions Permalink
  • Tim Cumming

    Brilliant feature. Is there a way to make this image display in the badge layout of the item? It seems to only display the text defining the image, not the image itself.

    1
    Comment actions Permalink
  • Rainer Grabowski

    Hi Tim,

    unfortunately that's not possible.

    Rainer

    1
    Comment actions Permalink
  • Mikkel Larsen-Ledet

    Great feature. Is only JPG allowed or could I somehow make PNGs accepted?

    0
    Comment actions Permalink
  • Rainer Grabowski

    Hi Mikkel,

    .png works too.

    Rainer

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk