Jump to content
  • 0

IF/THEN in Report


jeffs88keys

Question

Hello,

I understand that this may be an html box on my report.

I need to accomplish the following, and I'm not sure if can be done.  

If [field1] is blank or if [field2] (a file upload field) is empty, then return a statement "DISCLAIMERS OUT OF COMPLIANCE" (and maybe in red???)

(otherwise)  if [field1] is blank or [field2] (a file upload field) is empty, then return a statement "DISCLAIMERS IN COMPLIANCE" (and maybe in blue???)

Thanks !!!

 

2021-04-20_16-30-53.png.8e888726965b0e65e2cf7fe72f9943d1.png

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

What I can suggest for this is to use a formula field or calculated field instead for your detection if the field 1 and 2 is blank. Since you mentioned that one of those fields is a file field, you may want to check on this post for the formula that can help you. 

 

 

Link to comment
Share on other sites

  • 0

As for the changing of colors,  I'm afraid that you'll have to use a Javascript for that. If you are interested of changing the color of the entire row base on the results of the formula I mentioned above, please see this article: https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/

Link to comment
Share on other sites

  • 0

Hi @jeffs88keys,

You can give the following a try:

1) Add a HTML block in your report.

2) Click Source and add the following code:

<span id="[@field:ID#]showDisclaimer1" style="color:red"></span>
<span id="[@field:ID#]showDisclaimer2" style="color:blue"></span>
<script>

if("[@field:photo/]")
{
document.getElementById("[@field:Id#]showDisclaimer1").innerHTML="DISCLAIMERS OUT OF COMPLIANCE";
}
else
{
document.getElementById("[@field:Id#]showDisclaimer2").innerHTML="DISCLAIMERS IN COMPLIANCE";
}
</script>

 

Replace "ID" in [@field:ID] with the actual unique ID field name in your table. Also, replace "photo" in [@field:photo/] with actual file name in your table. Also add the other field that you wanted to verify in the IF condition.

 

I hope this helps.

Link to comment
Share on other sites

  • 0
On 5/13/2021 at 7:48 PM, BaySunshine said:

Hi @jeffs88keys,

You can give the following a try:

1) Add a HTML block in your report.

2) Click Source and add the following code:

<span id="[@field:ID#]showDisclaimer1" style="color:red"></span>
<span id="[@field:ID#]showDisclaimer2" style="color:blue"></span>
<script>

if("[@field:photo/]")
{
document.getElementById("[@field:Id#]showDisclaimer1").innerHTML="DISCLAIMERS OUT OF COMPLIANCE";
}
else
{
document.getElementById("[@field:Id#]showDisclaimer2").innerHTML="DISCLAIMERS IN COMPLIANCE";
}
</script>

 

Replace "ID" in [@field:ID] with the actual unique ID field name in your table. Also, replace "photo" in [@field:photo/] with actual file name in your table. Also add the other field that you wanted to verify in the IF condition.

 

I hope this helps.

Very grateful for your time.  I will give this a shot.  Thank you !!!

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...
×
×
  • Create New...