You can use the fallback behaviour of the logical ...
# suitescript
e
You can use the fallback behaviour of the logical AND operator:
Copy code
var createdFrom = (tranData.createdFrom[0] && tranData.createdFrom[0].value);