Added data to getCustomDataValue function for more flexibility