I presume that is from this line in your function var msg1 = { payload: rotated.SERVICELOCATIONID };
If so then you want var msg1 = { payload: rotated.SERVICELOCATIONID[0] };
From reading the code in your flow from the function node I think you have the variable both in msg and in msg1. Let's take what you have in msg1.
I would do something like this but it will just pick the first vaalue in the resulting array. If you have more values you have to loop through the array (next step if this works):
var msg1 = { payload: Number(rotated.SERVICELOCATIONID[0]) };