Search code examples
excelazureazure-blob-storageazure-logic-apps

How to store email attach csv file content as variable in azure logic app


I get a csv file as email attachment.I need a way to read email attachment and save that attachment as variable or directly read the attach file content and get data or store in blob storage.( If csv file save in blob , how we can read it. )

note - This csv file has data about system processes.I want to get only yes process from the attach csv file and continue the integration. ex- onboarding process | yes billing process | no

Here is the steps I tried.


Solution

  • For your requirement about "If csv file save in blob , how we can read it", I can provide a solution for your reference, please refer to the steps below:

    1. I have a csv file in my blob storage and its content show as below:

    item,date,process
    1,2020-01-01,yes
    2,2020-01-01,no
    

    2. Use "Get blob content" to get the content of the blob. enter image description here

    3. Search the action "Parse CSV" in you logic app. enter image description here

    It will ask you to input "API Key", you need to go to this page first --> click "Start free trial", register an account and create a new API Key. enter image description here enter image description here Copy the secret and paste it to your logic, it will allow you to connect Plumsail.

    4. Input the "File Content" and the headers into the box, we can also add a new parameter "Skip first line" and set it "Yes"(this parameter will skip the header line and avoid two lines header in the expect table). enter image description here

    5. Then you can loop the "Body" from "Parse CSV" action and use a "If" condition to judge if the "process" equals "yes" or "no", and do what you want in each branch flow. enter image description here

    Hope it helps~