Jump to content
  • 0
Sign in to follow this  
Altair

Formula field

Question

I have a two fields that I want to put into a formula field. I want the first field, and then if the second field is not blank, I want a line break or two, followed by the word 'Test: ' and the second field. How can this be achieved? The <br> + Test: should only appear if the citation field is not blank.

So if the second field is blank, it should be:
Field1

If not,
Field 1 + <br> + Test: Field2

I tried using Case to no avail, and can't even get this to work if I remove the <br> and just put in a space. Thank you!

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

May you please try the formula syntax below:

-----

[@field:Field1] + 

CASE WHEN DATALENGTH([@field:Field2]) = ''

THEN ''

ELSE '
Citation: ' + [@field:Field2]

END

----

This should always output the first field and concatenate the second field, if the second field is not blank.

It is possible that you have forgotten to put an ELSE block in your CASE Statement when you tried to do so. This is important because if the CASE Statement is not satisfied, it will return NULL. And doing operations with NULL values always results to NULL.

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...