Skip to main content
Known Participant
October 18, 2024
Answered

Merge a group of fields, but then add a specific word if a different cell has content

  • October 18, 2024
  • 1 reply
  • 519 views

Its Friday evening and my brain has given up!

 

The blue text works and merges the content of a bunch of cells perfectly

event.value = this.getField("A").value + this.getField("B").value + this.getField("C").value + this.getField("D").value;

 

where I'm stuck is merging the following for field E into the above:

if field E has numerical content, add the word Contract to the merge. If field E is blank, don't include anything

 

If someone could help, I would be very grateful.

 

thank you

This topic has been closed for replies.
Correct answer try67

Add this after your code:

 

var e = this.getField("E").valueAsString;

if (e!="") event.value+= " Contract " + e;

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 18, 2024

Add this after your code:

 

var e = this.getField("E").valueAsString;

if (e!="") event.value+= " Contract " + e;

jlehaneAuthor
Known Participant
October 20, 2024

Thank you - that's great!