Hello @Mike Kiser
Since the content of a .csv
file is a long string formatted as comma-separated-value where the new lines are delimited by \n
character, you can use String Concatenation to ensure that, whenever your .csv file is updated with new rows, the new rows are always added to the top. In other words, it can be a workflow process of always placing a subset of new comma-separated text at the beginning of an existing such text whenever an update occurs to a .csv
file.
Below is a very simple & basic example of such a workflow process with concatenation:
For the example above, I chose an HTTP trigger for starting the workflow and Azure Blob for storing my sample cities.csv
file. In the HTTP trigger, I specified that it should expect data for the new rows to be added in the Body of the request (done through JSON schema) and I named this new data as csvContent
which represents my new rows. Next, I used the Azure Blob Storage connector to fetch the current and existing content of the CSV file before updating it with new content. I then do exactly that by using the Update Blob action to update the .csv file with the combined data of both csvContent
+ File Content
data points.
If you're new to Logic Apps and/or have further questions, let me know and I'd happy to discuss. Depending on requirements, there are typically many other things to consider: average file size to be processed? how many files? character encoding, new lines character, etc.