Hello Community,
I'm very new to Power Automate and would like to request some help.
I'm trying to create a flow in which when I upload a CSV file, it will auto-populate the values into a SharePoint list. The issue that I'm having is that some of the CSV items have extra commas in them and I'm having a hard time trying to remove those specific commas.
For example my CSV file will consist of this:
| Reciept Number | Item | Purchaser |
| 1 | Shoes | Chris, Joe |
| 2 | Toothbrush, Toothpaste | Amanda, Phil |
| 3 | Ice Cream | Eric |
| 4 | Ham, Cheese, Bread | Michelle |
There is an extra comma between toothbrush and toothpaste and ham and cheese and bread that makes my current flow not work. If possible, I would like to eliminate all commas in the item column. As for the purchaser column, I would like to keep those. There will never be more than 2 purchasers and I have an extra column on my Sharepoint list to capture it as well.
Current output of the filter array before creating items in SharePoint:
[
"1,Shoes,\"Chris, Joe\"\r",
"2,\"Toothbrush, Toothpaste\",\"Amanda, Phil\"\r",
"3,Ice Cream,Eric\r",
"4,\"Ham, Cheese, Bread\",Michelle\r",
]
Ideal output of the filter array before creating items in SharePoint (no comma between toothbrush and toothpaste):
[
"1,Shoes,\"Chris, Joe\"\r",
"2,"Toothbrush Toothpaste",\"Amanda, Phil\"\r",
"3,Ice Cream,Eric\r",
"4,"Ham Cheese Bread",Michelle\r",
]
The basic structure of my flow is:
Upload to the CSV, convert it to a string, create a new line, split the string with the new line to create an array and remove the header, filter the array to remove blank rows and then finally take final set of arrays and populate them in the share based on their column index.
The image of my current flow, the output I have been getting and the output I want is attached as well.
If anyone has any ideas, I would love to hear it. I'm sure there's a much simpler way to do this that I'm just not aware of. I can also get the file in excel form as well if that makes things easier. I just haven't looked into that quite yet.
Thanks!