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

HELP list A to list B and update list B if needed

I really need help with this flow and my previous post haven't worked.

 

I have 2 lists.

 

List Projects

List NCSA

 

When a user inputs and item in list projects and the area selected is NCSA then I want to create an item in list NCSA. Pretty much copy what was inputed in list projects to list NCSA, but only if the area in projects is NCSA. Every time a certain item in list projects with area NCSA is changed then I wanted it to update the second list.

 

Please help. Please show me step by step how this would look. I have the same fields in both lists except for list NCSA I have "listAID" as a number type.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

Hey @karlagb20 

 

Here you go.

 

Creating the SharePoint

To test, I created 2 Lists.

Screenshot 2019-08-22 at 16.33.26.pngScreenshot 2019-08-22 at 16.33.35.png

I think this is what you have but with more fields. For this explanation, this will do.

 

Flow

In the flow you need to:

  1. Check if something was created or modified
  2. Check if it's NCSA
  3. If it's NCSA check if it already exists
    1. If I can find an item, update the values
    2. If not creates it.

Let's do that. Here's the flow. 

 

Screenshot_2019-08-22_at_16_37_07.jpg

This takes care of the validation.

 

Now let's explore the "Yes" Part:

Screenshot_2019-08-22_at_16_40_10.jpg

You have three parts:

  1.  Is there a listAID with the same as the updated value? If yes then I go in the update path and update the value
  2. If not, I create one.

In the compose, add the following code:

 

length(body('Get_items')?['value'])

It will return the number of items (usually one or zero).

 

 

Is this what you need?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

5 REPLIES 5
Super User II
Super User II

Hey @karlagb20 

 

Here you go.

 

Creating the SharePoint

To test, I created 2 Lists.

Screenshot 2019-08-22 at 16.33.26.pngScreenshot 2019-08-22 at 16.33.35.png

I think this is what you have but with more fields. For this explanation, this will do.

 

Flow

In the flow you need to:

  1. Check if something was created or modified
  2. Check if it's NCSA
  3. If it's NCSA check if it already exists
    1. If I can find an item, update the values
    2. If not creates it.

Let's do that. Here's the flow. 

 

Screenshot_2019-08-22_at_16_37_07.jpg

This takes care of the validation.

 

Now let's explore the "Yes" Part:

Screenshot_2019-08-22_at_16_40_10.jpg

You have three parts:

  1.  Is there a listAID with the same as the updated value? If yes then I go in the update path and update the value
  2. If not, I create one.

In the compose, add the following code:

 

length(body('Get_items')?['value'])

It will return the number of items (usually one or zero).

 

 

Is this what you need?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

Super User II
Super User II

Hey @karlagb20 

 

Here you go.

 

Creating the SharePoint

To test, I created 2 Lists

  1. Project with Title and Area (Choice)
  2. NCSA with Title and listAID

 

I think this is what you have but with more fields. For this explanation, this will do.

 

Flow

In the flow you need to:

  1. Check if something was created or modified
  2. Check if it's NCSA
  3. If it's NCSA check if it already exists
    1. If I can find an item, update the values
    2. If not creates it.

Let's do that. Here's the flow. 

 

Screenshot_2019-08-22_at_16_37_07.jpg

This takes care of the validation.

 

Now let's explore the "Yes" Part:

Screenshot_2019-08-22_at_16_40_10.jpg

You have three parts:

  1.  Is there a listAID with the same as the updated value? If yes then I go in the update path and update the value
  2. If not, I create one.

In the compose, add the following code:

 

length(body('Get_items')?['value'])

It will return the number of items (usually one or zero).

 

 

Is this what you need?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

@manuelstgomes wait... it doesn't update. instead it creates the same item again even though i only updated it on the projects list

@karlagb20 it's probably the IDs. Let's check them:

Screenshot_2019-08-23_at_15_07_16.jpg

  1. From the "When an item is created"
  2. From Apply To Each
  3. From the "When an item is created"
  4. From the "When an item is created"

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

@manuelstgomes It didn't work. It went straight to creating an item even though all I changed was a couple numbers on the original item. Below is how my flow looks, is something wrong? Why is it skipping update item?false.PNGsh.PNG

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (74,196)