Sidebar

If OBX3 is blank plug a 1

0 votes
219 views
asked Oct 29, 2020 by adam-d-5091 (320 points)
edited Oct 29, 2020 by adam-d-5091
What is the best way to have a 1 (or any value) be plugged if OBX-3 is empty?

1 Answer

+1 vote
 
Best answer

This will set OBX-3 where OBX-3 is blank/empty if you only have 1 OBX Segment: 

message.setNode('OBX[@3=\'\']-3', 'abc');

Use this code if there are multiple OBX Segments:

message.setAllNodes('OBX[@3=\'\']-3', 'abc');

answered Oct 29, 2020 by amanda-w-3695 (4,840 points)
selected Oct 29, 2020 by adam-d-5091
...