cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
karlagb20
Level: Powered On

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

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

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

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

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

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

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

karlagb20
Level: Powered On

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

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

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

@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

karlagb20
Level: Powered On

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

@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
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
Users Online
Currently online: 205 members 5,597 guests
Please welcome our newest community members: