AdHocProd
AdHocProd

Reputation: 1

In Power Automate, how to get data from a .csv email attachment and format it for display?

1st time posting a question... I have a simple task in Flow - I need to get data from a .csv email attachment, format it in an html table, and then send it in another email. I've seen several paid connectors and some other methods to "parse" the .csv data to create a JSON array - is the the best solution?

Trigger is "when an email is received." . . . Output is "send an email"

Any help is much appreciated!

Upvotes: 0

Views: 1581

Answers (1)

Eliot Cole
Eliot Cole

Reputation: 171

You could use Encodian's Parse CSV connector, it's free, but you need to create a free account with them.

The one thing I've noticed is that you might need to place the CSV Data value that it produces into an expression with a json() function to ensure that it is properly read. This is because the Flow HTML Table action detected the result from my test as a string, despite encodian stating it was JSON.

json(outputs('Parse_CSV')?['body/csvData'])

That is how it would look if you've changed none of the names of any of the actions.

As you say, there are many CSV connectors out there, the ones that mention JSON are simply formatting the result in to something that Flow can understand and work with in some ease.

Here is my flow, obviously yours will have the incoming email as the result, not the button. enter image description here

Upvotes: 1

Related Questions