Function transformFieldsToCacheObject