cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Hi Guys, I am having a problem with my flow.

 

So I have a PowerApps Application, that Creates an entry in a SharePoint List, in what I call here, List 1. That triggers my Flow, which creates a copy of List 1, into List 2, and gets all the attachments from List 1, and copies them over to List 2. It then deletes the entry from List 1. Essentially moving the List 1 Entry to List 2. Then it sends an email from a Shared Mailbox to a designated user, and to me.

 

Originally we were just using 1 attachment, so this flow worked perfectly for that. However I have been asked to allow up to 10 attachments. Now is where we have a problem. The flow works, however instead of putting all the attachments into a single entry in the sharepoint list, it is actually is creating muliple entries into List 2, and sending multiple emails.

 

I have looked at various solutions, and tried a few things including delay, absoluteuri, etc, but so far no dice.

 

So I need; When a New Item is created in List 1, that Entry including all attachments is then created in List 2, delete the List 1 entry. So in practical terms its List 1 to List 2.

 

As a bonus; if anyone can help. I'd like to attach the attachments to the email I send. I looked into Initializing Var, and appending, but that does not seem to work with the "Send an email from a shared mailbox (V2)", but I presume I did something wrong with my array. So if you can add that to the step, it would be great. I'd imagine the attachment copy would likely be similar.

I created per this tutorial; https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

 

This is a copy of my flow;

Microsoft Flow Error Multiple Attachments.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Was able to solve it in the PowerApps Community. Linking here for helping someone here as well.

 

Link:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Problem-Copying-One-SharePoint-List...

 

Thanks!

View solution in original post

15 REPLIES 15
Highlighted
Community Support
Community Support

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Hi @Phillip-JCI,

 

  1. Please move the Create item action in the middle of Get attachments and Apply to each actions:Annotation 2019-10-16 133835.png

     

  2. Send an email with attachments, you need to click the switch button (red circle), then put the attachment array into it.

    Annotation 2019-10-16 133640.png

     

    Annotation 2019-10-16 134303.png

     

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

@v-litu-msft Thanks for the reply, I built the flow as per your instructions, however the flow failed. It ran fine until the Apply to each 2 on the Send from Shared Mailbox.

 

Also multiple attachments still cause the issue of creating multiple entries.

 

Flow Error Attached:

Microsoft Flow Error 2.png

Highlighted
Community Support
Community Support

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Hi @Phillip-JCI,

 

Could you please share the configuration of Send an email from shared mailbox?

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Hi @v-litu-msft, absolutely. It is attached. All the fields are from List 1. They worked fine before. Thanks!

 

Microsoft Flow Error 3.png

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

@v-litu-msft, please don't forget about me!

 

Perhaps @RezaDorrani  you can help as well? I added the flow per your recomendation on securing SharePoint Lists.

 

Thanks!

Highlighted
Community Support
Community Support

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Hi @Phillip-JCI,

 

Sorry for the delay, it is caused the wrong dynamic content input because of you restructured your Flow, please make sure these Dynamic content in Send email action have no parts of modified. It is better to recreate it, please make sure they correct.

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

@v-litu-msft , I don't understand your statement, I have not made any changes to the flow. The only parts changed, were the ones you advised me to change. Can you please clarify?

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

@v-litu-msft please see above, still having issues.

 

Anyone can chime in as well?

 

Thanks!

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Final Check in, before having to create a new thread.

 

@v-litu-msft  or anyone else can help?

 

Thanks!

Highlighted
Community Support
Community Support

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Hi @Phillip-JCI,

 

Please delete all the content of email body, then have a test.

  1. -If it has error report, the issue will be caused by SharePoint list 1  - Please confirm the NotifyEmail column whether it exists value, if not, please add a Get item action before the send email and get the newly created item again.
  2. -If it not report issue, please check the output of Get attachments action.

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Post did not post, and duplicated later.

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

I had posted a reply, but unfortunately did not post, or was deleted, not sure.

 

Unfortunately @v-litu-msft , this isn’t working, and I am not able to discern exactly what you are asking me to do, because from what I tried, it did not work. Also any data that’s on the email portion of it that you are asking me to delete, does not affect the Attachments issues I have, and all that data is basically text strings. It’s a copy of the columns of the submission essentially that I would like emailed to the end users, an admin. So it shouldn’t matter.

 

 So let’s start over. I am attaching a complete breakdown of my current functional flow. It does not contain the initialize variable portion as of yet, because that was not working and this is a production environment, so I had to remove it, until we have something that is tested and working.

 

Pain Point:

Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

 

Environment:

There are two SharePoint Lists. MasterDB and Submissions. MasterDB is henceforth known also as List 1, and Submissions as List 2. The PowerApps applications writes to MasterDB. All data including attachments is saved correctly in MasterDB. Up to 10 attachments must be possible.

 

What I want to accomplish?

The Goal is to take a “entry” from MasterDB or List 1 and copy/transfer it over to Submissions or List 2, including transfer over any attachments embedded into that entry.

 

The reason this is necessary is because MasterDB has to have edit permissions in order for PowerApps to work correctly, however we do not want end users to have access to all the submissions, so Submissions or List 2 has special permissions attached to it, and thus entries need to be moved over.

 

Assumptions: PowerApps is able to write a SharePoint List entry into MasterDB including attaching any Attachments to that entry.

 

Microsoft Flow:

My Current Flow:

Master Flow Breakdown.png

 

When an Item is created in MasterDB (Triggers the flow)

Gets Attachment from that entry.

Now Checks whether there is an attachment or not, which splits the flow as a condition.

If Yes: The entry contains an attachment, it gets all the attachment content, creates an entry into Submissions or List 2. This entry is a copy of all the fields in MasterDB or List 1. Then adds the attachment(s) to the List 2 entry.

Deletes the MasterDB entry

In parallel Does these two actions;

  • Generates an Email from a Shared Mailbox that contains all the column fields in the entry for an end user.
  • Generates an Email from a Shared Mailbox to the Admin, or Myself that tells me that an entry has been created. It’s how I monitor that the process is working correctly.

If No: Creates an entry into Submissions or List 2. This entry is a copy of all the fields in MasterDB or List 1.

Then generates an Email from a Shared Mailbox that contains all the column fields in the entry for an end user. However the Dynamic Content Has Attachments, is false. This seems redundant from the shared email below also, but was working and not sending 2 emails, so I kept it.

Then In parallel Does these two actions;

  • Generates an Email from a Shared Mailbox that contains all the column fields in the entry for an end user.
  • Generates an Email from a Shared Mailbox to the Admin, or Myself that tells me that an entry has been created. It’s how I monitor that the process is working correctly.

 

What works?

If a Submission does not contain any attachments, the flow works successfully.

If a Submission contains one attachment only, the flow works successfully.

 

What’s broken?

If a Submission contains more than one attachment, the flow works however instead of putting all attachments into a single entry, it actually loops and creates the same entry multiple times, depending on how many attachments were in MasterDB or List 1. I.E There are two attachments in MasterDB, the flow triggers, and will create two identical entries into Submissions or List 2. The two identical entries, one will have attachment 1, and the second identical entry will have attachment 2, so the process is looping.

 

What’s missing?

I would like to add all the attachments likely via an Array to the Shared Mailbox emails. So that the end user receives the same attachments that are stored in the SharePoint List. I know this should be possible via array, but because of the looping attachment entry problem, I want to troubleshoot the flow, and then add that functionality.

 

Ideal Flow:

When an Item is created in MasterDB, (Trigger Flow)

Get all Content; both Column Entries and Attachments in this MasterDB Entry.

If there is an Attachment

Get Attachment Content,

Create an Entry into Submissions or List 2, that mirrors the MasterDB Entry.

Add all Attachments from MasterDB Entry, List 1 to Submissions Entry List 2.

Delete the MasterDB List 1 Entry, since its been essentially duplicated in Submissions List 2.

Send an Email from a shared mailbox to the End User with all the dynamic content fields that were contained in all the columns from this entry. Including Add to this email as an attachment, all the attachments that were in the MasterDB entry.

Then in Parallel

Send an Email from a shared mailbox to a specific admin, include the attachments from the MasterDB entry as well.

 

In simple terms. Take the MasterDB Entry, move it to Submissions. Send Admin Email that confirms entry with attachments if applicable, and Send an end user an Email with essentially a copy of the submission with attachments if applicable.

 

I am open to changing any part of the flow, I just need it to do this functionality. We are close, but far since that duplication issue and overall bugginess of the process.

 

Anyone feel free to chime in,

 

Thanks!

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

@v-litu-msft Did you have a chance to review the post above?

 

Anyone have an idea?

 

Open to anything, need to fix asap.

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

I am open to other solutions, anyone?

 

I may try the PowerApps community also, since this thread doesn't seem to gain traction, but hopefully someone ran into the same use case?

 

Thanks!

Highlighted
Helper I
Helper I

Re: Problem Copying One SharePoint List to Another SharePoint List including all Attachments. Flow creates multiple entries.

Was able to solve it in the PowerApps Community. Linking here for helping someone here as well.

 

Link:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Problem-Copying-One-SharePoint-List...

 

Thanks!

View solution in original post

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (5,168)