Dynamic column name for csv data logging

I am logging data for 12 sensors in a CSV file, where each sensor corresponds to a specific column (e.g., Sensor1, Sensor2, Sensor3, etc.). I want to dynamically assign column names for each sensor through text input. While I have implemented the logic, the sensor data is mixing up with data from other sensors. Could you review my logic and provide suggestions to correct this issue?


please find the flow file in attachment

flows.json (16.0 KB)

Your flow looks overly complicated.

It would be best to keep the sensor csv as timestamp,sensor1,sensor2.....
Then keep a separate cvs/lookuptable that maps the sensors to the dynamic column name/plant for displaying the cvs with the updated names.

I think you need to explain fully and clearly explkain how the data arrives and how it is logged. do you wait for all sensors etc before logging.