
Announcements
I need to extract subject values and store in list columns and at the same time email attachments to be stored in the document library based on the subject line values folder names before adding attachment. please refer below expected output
Email Template //Sample
Subject: Country: Kenya\Customer: client1\Contract Number: 43291\Type: Renewed\Region: Washington\Department: Sharepoint
Sharepoint List for storing subject values
Country-Single line of Text;Customer-Single line of Text;Contract Number-Single line of Text;Type-Single line of Text;Region-Single line of Text,Department-Single line of Text
Question: How to extract incoming email as per above example subject and create item into sharepoint list respective columns and to store email attachments in the document library
Expected output
List :
Country: Kenya
Customer: client1
Contract Number: 43291
Type: Renewed
Region: Washington
Department: Sharepoint
Library //To create defined folder based on the subject values
Year\month\country\customer\Department\Region\Type(predfined values)
So ideally,we need to check these subject values of the above columns dynamically and create a folder structure and store attcahments which we recieve in email
2024\July\Kenya\client1\sharepoint\Washington\Renewed
Hi @Veblitz
To address your query, you can leverage a cloud flow that initiates with the trigger “When a new email arrives”. This trigger will allow you to access the subject of the incoming email. You can then process the subject line to extract the required information using appropriate expressions, you can use split() Split function - Power Platform | Microsoft Learn, and store these extracted values in separate variables.
Once you have these variables, you can utilize the “Create Item” action from SharePoint connector to populate the columns of your list with the corresponding variables.
If there’s a need to create a new folder, you can do so using the SharePoint action “Create new folder”. This will allow you to organize your data based on the subject line values.
SharePoint - Connectors | Microsoft Learn
Finally, you can add the email attachments to the newly created folder using "Create file" action. This way, you can dynamically check the subject values, create a structured folder based on these values, and store the email attachments accordingly.
I hope this helps!