Sidebar

How to remove a subfield

0 votes
328 views
asked Oct 28, 2020 by adam-d-5091 (320 points)
Pretty simple. For example:

OBX|1|FT|This^That|

How do I remove "This" and leave just "^That"

 

Thanks in advance!

1 Answer

+1 vote
 
Best answer
message.setNode('OBX-3', message.getNode('OBX-3.2'));
answered Oct 28, 2020 by michael-h-5027 (14,350 points)
selected Oct 28, 2020 by adam-d-5091
commented Oct 28, 2020 by adam-d-5091 (320 points)
That did it, what would be the cleanest way to add  back the carrot so it's: ^That
commented Oct 28, 2020 by michael-h-5027 (14,350 points)
My first update would basically wipe out OBX-3 and replace it with just the value from OBX-3.2 but if you just wanted to blank out OBX-3.1 you could do this.

message.setNode('OBX-3.1', '');
...