Displaying Images in Calculation Field
Hi i'm wanting to retrieve an image in a calculation field, and then display that image.
I have seen it done elsewhere, and i was just wondering what i am doing wrong? My code seems to be fine and the field is taking in the calculation, but instead of returning an image it is returning a boolean value of 0 or 1.
Why is it doing this? For example my code is of follows:
if(Product Safety Status Type=="Type 3"){
var typeThree = ''
}
If the field is equal to Type 3, i am just getting a result of '1'.
Any help would be much appreciated, thanks
-
Hi Jemma,
you need to use markdown syntax for displaying an image.
var imgThree = ''; 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
-
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
Please sign in to leave a comment.
Comments
10 comments