โ02-11-2026 06:21 AM
Hello all,
Currently I have a crazy requirement where the headers of a csv file are dynamic, I noticed just now that I can't access any pills in formula mode in order to write a lookup formula for headers section in compose csv action.
Currently the only way I can think of is handling it with if and else conditions based on a field from input and compose csv accordingly.
Is there any other efficient way we can achieve this?
Thanks in advance.
Solved! Go to Solution.
โ02-11-2026 09:23 PM
Hi @Bhagya_pola ,
My perspective on this requirement is as follows:
Assuming contents (headers to be formed) are coming from application or from file.
Using multiple IF/ELSE conditions would make the design overly complex and reduce readability.โ
Try this approach and let us know if you need further help.
Thanks and Regards,
Shivakumara K A
โ02-12-2026 07:27 AM
I wouldn't put the actual headers in the CSV compose action. In the action, name the columns something simple like "a,b,c,d,e" and generate the CSV without a header line.
Then, generate your dynamic headers however you want and simply "text add" the headers to the CSV output. You don't need Python or Ruby for this. You can do this in any input field.
It's as simple as:
"header1,header2,header3\n" + [CSV output datapill]
The headers could be another data pill or text.
Important: Don't forget the "\n" at the end to make a new line between the headers and CSV.
Check this post too. It's very similar to your issue and has the same solution:
https://systematic.workato.com/t5/workato-pros-discussion-board/csv-formatting-challenge/m-p/7994
If you're having trouble making the dynamic headers, then I would need to see your data source.
โ02-12-2026 07:27 AM
I wouldn't put the actual headers in the CSV compose action. In the action, name the columns something simple like "a,b,c,d,e" and generate the CSV without a header line.
Then, generate your dynamic headers however you want and simply "text add" the headers to the CSV output. You don't need Python or Ruby for this. You can do this in any input field.
It's as simple as:
"header1,header2,header3\n" + [CSV output datapill]
The headers could be another data pill or text.
Important: Don't forget the "\n" at the end to make a new line between the headers and CSV.
Check this post too. It's very similar to your issue and has the same solution:
https://systematic.workato.com/t5/workato-pros-discussion-board/csv-formatting-challenge/m-p/7994
If you're having trouble making the dynamic headers, then I would need to see your data source.
โ02-12-2026 11:16 PM
Oh, looks like a great work around,
let me give it a try ๐
โ02-11-2026 09:23 PM
Hi @Bhagya_pola ,
My perspective on this requirement is as follows:
Assuming contents (headers to be formed) are coming from application or from file.
Using multiple IF/ELSE conditions would make the design overly complex and reduce readability.โ
Try this approach and let us know if you need further help.
Thanks and Regards,
Shivakumara K A
โ02-11-2026 11:46 PM
Hi @shivakumara ,
Thanks! Yes, Iโm currently trying this approach and will see how it goes.