cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Copying a filtered SharePoint list

Hope someone can help with this. I have a project list on one of our site collections with all of our projects on it. What we want to do is to copy only one client's items from the project list to a client list in a different site collection, and keep that updated, so that we can share this site with the client and they will only see their information, and not all the information from our various clients.

 

I've been able to set up a flow that creates new entries in the client list once it's added in our project list, with a filter to only add one client's items, and that works fine. The problem I have is with another flow which is triggered each time an item is changed. Because the Update Item action requires an ID, I've been asking it to use the ID from the project list to identify which item to update, but when the item is created in the client list, it's created with a different ID so the flow therefore can't find it to update it.

 

Can anyone think of a way around this? Or have I gone about this the wrong way?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Copying a filtered SharePoint list

Hi @Anonymous,

 

Could you please share a screenshot of your flows' configuration?

Could you please show a bit more about your project list and client list?

Could you please share a bit more about your filter condition?

Further, do you create two separated flows on your side, one flow is fired when an item is created in your project list, another flow is fired when an item is modified in your project list?

 

I suppose that there is a column to identify the client uniquely in your project list, is it true? I have created a project list on my side and the data structure of it as below:16.JPG

Note: ProductName column is a Single line of text type column, which is a unique column. Production Date column is a Date type column. Cost column is a Number type column. Client Name column is Single line of text type column, which is also a unique column.

 

I have also created a client list on my side and the data structure of it as below:17.JPG

Note: ProductName column, Production Date column and Cost column has same data type with my project list.

 

In addition, I think it is not necessary to create two separated flows. I have made a test on my side and please take a try with the following workaround:

  • Add a "When an item is created or modified" trigger, specify Site Address, List Name set to project list.
  • Add a Condition, left input box set to Created dynamic content of the trigger, right input box set to Modified dynamic content of the trigger, within middle drop down, choose is equal to.
  • Within "If/yes" branch of Condition, add a Condition 2, left input box set to Client Name (Custom column which is mentioned above) dynamic content of the trigger, right input box set to Kris Dai, within middle drop down, choose is equal to.

         Within "If/yes" branch of Condition 2, add a "Create item" action, specify Site Address, List Name set to a client list.

 

  • Within "If/no" branch of Condition, add a "Get items" action, specify Site Address, List Name set to the client list. Then add a "Filter array" action, From set to output of "Get items" action, left input box set to ProductName dynamic content of "Get items" action, right input box set to ProductName dynamic content of the trigger, within middle drop down, choose is equal to.

         Add a "Apply to each" action, input parameter set to output of "Filter array" action. Within "Apply to each", add a "Update item" action, specify Site Address, List Name set to the client list. Id field set to following formula:

items('Apply_to_each')?['ID']

Title field set to following formula:

items('Apply_to_each')?['Title']

ProductName field set to ProductName dynamic content of the trigger, Production Date field set to Production Date dynamic content of the trigger and Cost field set to Cost dynamic content of the trigger.

 

Image reference:18.JPG

 

19.JPG

The flow works successfully as below:20.JPG

 

21.JPG

 

 

Best regards,

Kris

 

 

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

View solution in original post

1 REPLY 1
Highlighted
Community Support Team
Community Support Team

Re: Copying a filtered SharePoint list

Hi @Anonymous,

 

Could you please share a screenshot of your flows' configuration?

Could you please show a bit more about your project list and client list?

Could you please share a bit more about your filter condition?

Further, do you create two separated flows on your side, one flow is fired when an item is created in your project list, another flow is fired when an item is modified in your project list?

 

I suppose that there is a column to identify the client uniquely in your project list, is it true? I have created a project list on my side and the data structure of it as below:16.JPG

Note: ProductName column is a Single line of text type column, which is a unique column. Production Date column is a Date type column. Cost column is a Number type column. Client Name column is Single line of text type column, which is also a unique column.

 

I have also created a client list on my side and the data structure of it as below:17.JPG

Note: ProductName column, Production Date column and Cost column has same data type with my project list.

 

In addition, I think it is not necessary to create two separated flows. I have made a test on my side and please take a try with the following workaround:

  • Add a "When an item is created or modified" trigger, specify Site Address, List Name set to project list.
  • Add a Condition, left input box set to Created dynamic content of the trigger, right input box set to Modified dynamic content of the trigger, within middle drop down, choose is equal to.
  • Within "If/yes" branch of Condition, add a Condition 2, left input box set to Client Name (Custom column which is mentioned above) dynamic content of the trigger, right input box set to Kris Dai, within middle drop down, choose is equal to.

         Within "If/yes" branch of Condition 2, add a "Create item" action, specify Site Address, List Name set to a client list.

 

  • Within "If/no" branch of Condition, add a "Get items" action, specify Site Address, List Name set to the client list. Then add a "Filter array" action, From set to output of "Get items" action, left input box set to ProductName dynamic content of "Get items" action, right input box set to ProductName dynamic content of the trigger, within middle drop down, choose is equal to.

         Add a "Apply to each" action, input parameter set to output of "Filter array" action. Within "Apply to each", add a "Update item" action, specify Site Address, List Name set to the client list. Id field set to following formula:

items('Apply_to_each')?['ID']

Title field set to following formula:

items('Apply_to_each')?['Title']

ProductName field set to ProductName dynamic content of the trigger, Production Date field set to Production Date dynamic content of the trigger and Cost field set to Cost dynamic content of the trigger.

 

Image reference:18.JPG

 

19.JPG

The flow works successfully as below:20.JPG

 

21.JPG

 

 

Best regards,

Kris

 

 

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

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,559)