Creating a Calculated field that use IF/Then display logic | Community
Skip to main content
Level 4
November 15, 2024
Solved

Creating a Calculated field that use IF/Then display logic

  • November 15, 2024
  • 1 reply
  • 1236 views

looking to create a calculated field that displays the text from two other calculated fields.  However if both fields exist, default to only display the second field.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by RandyRoberts

displaying the source data with an IF(ISBLANK( statement is doable. I don't know the order of calculations in a form but if the source fields aren't calculated first, your third calc field will be blank every time. I've never tried calculating two already calculated fields since I'm skeptical if it can even be done. You may have to recreate the calcs in those two fields into the third one instead of trying to calculate 2 calc fields.

If you do a standard CONCAT on a third field with no IF ELSE statement, does it work?

1 reply

RandyRoberts
Community Advisor
Community Advisor
November 15, 2024

Are the source calc fields on the same object or form? If so, you may run into the problem where your calc field won't display anything because your source fields haven't calculated yet.

Another consideration is that if your CONCAT is CONCAT(source1, source2) it will display only the second source if the first doesn't exist anyway!

I've never tried something like that but it sounds like a pretty high if not 100% failure rate.

 

Perhaps someone who's tried it can weigh in?

Level 4
November 15, 2024

yeah source 1 is always going to exist, but if source 2 exist, I would like for the code/formula to disregard the first source and only display  the second.  Hopefully that makes more sense.  Both source fields will live on different forms but at the project level.

 

RandyRoberts
Community Advisor
RandyRobertsCommunity AdvisorAccepted solution
Community Advisor
November 15, 2024

displaying the source data with an IF(ISBLANK( statement is doable. I don't know the order of calculations in a form but if the source fields aren't calculated first, your third calc field will be blank every time. I've never tried calculating two already calculated fields since I'm skeptical if it can even be done. You may have to recreate the calcs in those two fields into the third one instead of trying to calculate 2 calc fields.

If you do a standard CONCAT on a third field with no IF ELSE statement, does it work?