I have a workflow which contains a loop to format data and then write the sheets to Excel. The Excel writer has 2 tabs per loop.
I want the tab names to be “Sample 1 lines”, “Sample 1 pivot”, “Sample 2 lines”, “Sample 2 pivot”, etc. but at the moment it just seems to be using the array string (e.g. "[Sample 1 lines, Sample 1 pivot]).
Is there a way to use a variable for the sheet names?
The component you are using has ‘\n’ as a delimiter in the Cell Splitter node, thus taking your input as a single string.
You can unlink the component and make changes as per your requirement (change the delimiter from ‘\n’ to ‘,’) or just copy the content of the component outside in the workbench and make the changes then create a new component.
I think I am having a dumb moment because I understand the principle of what you are saying but not too sure how to execute this! Would you be able to explain further?
And what it currently ends up with is this (i.e. creates the lines and pivot tabs for sample 1 then only the lines tab for the remaining samples with the wrong name)…
The component Create String Array Variable uses a cell splitter node. As per current settings within the component, it is splitting the strings which are separated by the next line character (‘\n’), since your data is separated by ‘,’ it is being treated as a single string (since there is no ‘\n’ character). So in the current settings, the array consists of a single element.
I hope the image below explains it in an easier way.