Function to get the node data to add