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

  • Hello guys, can you please share a code that I could entirely copy and paste into calculation field if i want to see a picture? I don't know how to code, so i need to copy it all. Thank you very much.
  • 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.
  • 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
  • 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
  • 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?
  • 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
This question is closed.