We have found application integration to be quite poor at handling null strings. You may be better keeping the database field as a string if that is at all possible. (This is what we have done for our MySql inserts)
Otherwise the only way I have found of detecting a field it null would be to do a ‘GET_PROPERTY’ on the JSON, map onto a String field and do a LENGTH on the string - as shown here.
After that you should be able to use some conditional logic on the resulting ‘trans_id_length’ field and if 0 insert into the database without the field, or if greater that 0 then you can do your ‘TO_INT’ conversion and insert into the database. Not great if you have multiple integers in the database !
It may be worth getting a fault raised as there doesnt seem to be an easy solution for what should be a straight forward problem. The only other thing I can suggest is appending a 0 at the start of your number, i.e.