Dear Team,
I have a usecase in which I have 2 sharepoint list. I want to read the content of list 1 using a filter from each item of list 2, then attach the content as an excel file to an email and send the emails.
I am doing it this way:
- read the content of list 2
- create a excel file in a sharepoint document library using a template
- for each item in list 2
- read list 1 with the filter
- compose a json
- add a row to an excel table using the json
- read the file content
- send an email using the file content as attachment
In this approach everything works except the excel file has only 1 entry in the email attachment where as the excel file in the sharepoint document library has more than 1 entry.
so I did the other approach
- read the content of list 2
- create a excel file in a sharepoint document library using a template
- for each item in list 2
- read list 1 with the filter
- compose a json
- add a row to an excel table using the json
- list all the files in the sharepoint document library folder
- apply to each file
- fetch the file contents
- send email with the email attachment
This approach works !
But in both this approach I am write an excel file which I do not need to, is there any way I can send the email with excel attachment without the need to write the excel file first as I have all the data with me.
Thanks a lot in advance!