cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
R4ffen
Regular Visitor

Use a flow to update a second Sharepoint list

I have a list A with columns:

 

Date:SomeThingOwner
2020-04-09CarJames
2020-04-09TableJenny
2020-05-09ChairJames
2020-06-09PensilTom
AND SO ONAND SO ONAND SO ON

 

And want to make another list B where Power Automate does the work. I want the list to look like this:

 

Date:JamesJennyTom
2020-04-09Car Table 
2020-05-09Chair  
2020-06-09   Pensil
AND SO ONAND SO ONAND SO ONAND SO ON

 

I have tried many things with if then, but I cant get it to work. In list B I only want the date on one row, and the flow has to update with new dates when they are put in list A, and then put the right thing to the right owner on the right date.

 

Maybee someone has a better solution to this? I appriciate any answers. Please explain to a novice.

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @R4ffen,

 

According to your requirements, you should create two Flows as below:

Flow one, get all dates from List A, then get an array of Dates without repeat date by the following expression. Then create items in List B:

union(body('Select'),body('Select'))

Annotation 2020-04-10 142836.png

 

Annotation 2020-04-10 142918.png

 

Flow two, Get items in List A, then create Switch action to according to the owner to choose put the SomeThing into which column in List B:

Annotation 2020-04-10 144708.png

 

Annotation 2020-04-10 144748.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.

View solution in original post

3 REPLIES 3
ChristianAbata
Super User II
Super User II

hi @R4ffen  this is exactly what you need

http://johnliu.net/blog/2018/6/do-group-by-in-flow-with-two-simple-elegant-loops



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
v-litu-msft
Community Support
Community Support

Hi @R4ffen,

 

According to your requirements, you should create two Flows as below:

Flow one, get all dates from List A, then get an array of Dates without repeat date by the following expression. Then create items in List B:

union(body('Select'),body('Select'))

Annotation 2020-04-10 142836.png

 

Annotation 2020-04-10 142918.png

 

Flow two, Get items in List A, then create Switch action to according to the owner to choose put the SomeThing into which column in List B:

Annotation 2020-04-10 144708.png

 

Annotation 2020-04-10 144748.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.

View solution in original post

Hi @v-litu-msft 

 

Thanks for that solution, It worked. But I need to upgrade it. I need to be sertain that it never writes more than one row with the same date, so that the first flow with the "create Item" in sharepoint list dont add another row with the same date. I want it to add new dates from list A but not if it already exist i list B. I quess this is a common challenge updating list from one list to another.

 

And second: I have 7 different names, thats 7 different case in the switch. Is this going to be slow when it has to work with many rows?... It is some way to make it work faster? It has to load list B many times for example....

 

But thanks again!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (86,008)