Hello P Automate community,
I need help with the following flow, this is the problem statement:
"I need to send out one email to 5 different regions with a PDF attachment which is coming from 'Export file from Power BI'".
The emails should have this structure:
Email 1 for Region 'a'
Email 2 for Region 'b'
I'm looping from two SharePoint lists, one with Region and one with Metrics, ideally I want the 1st loop to go through the region list, create the Power BI PDFs with the applied metrics and put all the PDFs in one single email. This is the error I'm getting:
Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Attachment_Array' at line '1 and column '4259' cannot reference action 'Attachment'. The action 'Attachment' is nested in a foreach scope of multiple levels. Referencing repetition actions from outside the scope is supported only when there are no multiple levels of nesting.'.'.
Thanks for your help, I appreciate any ideas or suggestions.
Hi @FLMike
Are you able to generate a mockup flow with your suggestion? I have limited experience with variables.
I appreciate your response.
Hi @esulyma
The issue is, that your trying to use an outputs that will be a loop. You cannot do that from outside and then re-use it somewhere else.
You simply have to create your array inside the loop then use the Variable(array) directly. versus what you are doing. which is a double .. anyway it doenst like it.
Make sure to set your Apply to each (click the ... Concurrency On, Value = 1)
Then after you attach and send your next statement should be to set the Array to empty before doing it for the next region.
If you like my answer, I would really appreciate if you please Mark it as Resolved, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492