Jump to content
  • 0

How to dynamically display a image if the field has value if not hide


SunakoChan
 Share

Question

2 answers to this question

Recommended Posts

  • 0

Hi Sunako,

You  want to dynamically display the image base on the value of a field, this is possible using a Case statement in a calculated field.


Below is the step by step instruction on how to achieve this:
1. Go the result page then add a calculated field
2. Case statement(you need to change the name of the field):
Case
When [@field:FIELD] = ' ' Then ' '
Else '<img src="IMAGE_URL" />'
End
3. Add HTML BLOCK
4. From there you can call the Field link and the calculated field(Make sure that you render the calculated field as HTML). The format should look like this: <a href="[@field:FIELD]">[@calcfield:1!]</a>

image.png.dadb5d7ba8d154feb6b3495b53c1fe21.png

 

Link to comment
Share on other sites

  • 0

Hi @SunakoChan ,

If you want to hide the Calculated field you may use this code on the header:

<style>

#target table:nth-of-type(1) td:nth-of-type(4) {display: none;}
#target table:nth-of-type(1) th:nth-of-type(4) {display: none;}

</style>

</header>
<div id="target">
<header>

For the reference of this code, you may check this link: https://forums.caspio.com/topic/5323-hide-column-in-tabular-repor

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...