I am querying a SharePoint List and using the Create CSV Table action to generate a CSV file.
However I want the file to be pipe("|") separated.
Is there a way to change the delimiter when creating a CSV file. I would greatly appreciate any advise on this.
Solved! Go to Solution.
If you intend to do this with the data contained in a SharePoint List, you could :
1) Get your elements with the SP connector;
2) Initialize a string variable with the columns names you would like, e.g. "name;surname;email" and by hitting enter to add a carriage return;
3) Use "Apply to each" on the value element returned by the SP Get elements block;
4) In the apply to each loop, use an "Add to string variable", where the content would be the dynamic fields extracted from SP, separated with ";" and with a carriage return at the end of the line (hit enter)
Then you can add your string variable as the content of an attachment for instance.
Hope this helps !
Hi @Admin_A
thank for your reply.
I had taken a similar route in order to reach the same destination.
I'm creating the CSV table as intended by MS Flow, but I'm using 'custom columns'.
On each header/column I'm adding some special characters (note that these are also forbidden in the SP list, via column validation).
Note the pipes encapsulating the content (everywhere except the line jump, since I'm using the default carriage returns on the CSV).
My aim was to create an easily replaceable set of characters (in my case, pipe-comma-pipe) I could look for, and then replace it as a whole for the character I need to be used as separator.
So next step is a compose action with a replace expression for the 'character set' I created.
I look for |,| and then replace it with my desired separator.
I also didn't needed to take the carriage retun into account since I'm using the default ones created for each line on the CSV.
I hope thi can help someone ๐
Hi @nrdas,
By default, a comma is used to separate the items. If you want the file to be pipe separated, you could use a replace function to replace the comma with a pipe.
Under the Create CSV table, add a Compose action, and use the following code:
replace(body('Create_CSV_table'),',','|')
Then in the email body, select the output from the Compose action.
Please have a try with it on your side.
Best regards,
Mabel Mao
HI Mabel,
Thank you for the reply but the solution proposed by you will also replace any comma in the input file with a pipe ('|').
I just want the separator to be changed from comma to pipe while keeping the "commas" elsewhere intact.
Any updates on this topic?
This is 2 years old and a pretty basic feature.
Has anyone come up with a working solution that doesn't reaplace all particular characters in the CSV but only the delimiter/separator?
Thanks in advance for your help,
Best regards
I am also looking for a solution for this. Any update?
If you intend to do this with the data contained in a SharePoint List, you could :
1) Get your elements with the SP connector;
2) Initialize a string variable with the columns names you would like, e.g. "name;surname;email" and by hitting enter to add a carriage return;
3) Use "Apply to each" on the value element returned by the SP Get elements block;
4) In the apply to each loop, use an "Add to string variable", where the content would be the dynamic fields extracted from SP, separated with ";" and with a carriage return at the end of the line (hit enter)
Then you can add your string variable as the content of an attachment for instance.
Hope this helps !
Hi @Admin_A
thank for your reply.
I had taken a similar route in order to reach the same destination.
I'm creating the CSV table as intended by MS Flow, but I'm using 'custom columns'.
On each header/column I'm adding some special characters (note that these are also forbidden in the SP list, via column validation).
Note the pipes encapsulating the content (everywhere except the line jump, since I'm using the default carriage returns on the CSV).
My aim was to create an easily replaceable set of characters (in my case, pipe-comma-pipe) I could look for, and then replace it as a whole for the character I need to be used as separator.
So next step is a compose action with a replace expression for the 'character set' I created.
I look for |,| and then replace it with my desired separator.
I also didn't needed to take the carriage retun into account since I'm using the default ones created for each line on the CSV.
I hope thi can help someone ๐
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
45 | |
41 | |
38 | |
38 | |
34 |
User | Count |
---|---|
87 | |
85 | |
52 | |
48 | |
40 |