web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help with Arrays & Obj...
Power Automate
Unanswered

Help with Arrays & Objects

(0) ShareShare
ReportReport
Posted on by 4

Hello! I'm trying to accomplish a specific task and am very new to Power Automate. I'm hoping someone can help me with this. 

 

I have a list of items coming into the workflow by which the workflow is triggered on change. Let's say this is LIST A. 

1. Component

2. Component Type

3. Dashboard ID

 

I'm working with a SharePoint list. Let's say the List is LIST B. This list has a few columns that I am interested in retrieving. Below are the list of columns:

1. ID

2. Component 

3. Component Type

4. Dashboard ID

 

List B is retrieved when Dashboard ID on LIST A finds a match with LIST B. 

 

I need help achieving the below:

Condition 1: If no items are retrieved from LIST B with the matching Dashboard ID from LIST A, I need to insert rows into LIST B with the details from LIST A. I call this an 'insert' pile

Condition 2: If a match is found from LIST B with the matching Dashboard ID from LIST A

                     AND the Component, Component ID exists on LIST B AND does not exist on LIST A

                     I need to delete the row in SharePoint from LIST B. I call this a 'Delete' pile

Condition 3: If a match is found from LIST B with the matching Dashboard ID, Component, Component Type from LIST A, no action is needed. I call this a 'keep' pile

 

To add to this, I have about 9 lists of the LIST A type that I need to collect and perform the same action with LIST B.

 

I have tried this in several different ways and couldn't get anywhere. Please let me know how I can achieve this efficiently, and any help is greatly appreciated.

 

Thank you!

 

 

 

 

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @thecoolcracker 

    Manual Trigger

    Use a Manual Trigger in your flow. You can change this later .. however while you are building a testing a flow—a manual trigger is best as you can quickly test your flow at each stage and troubleshoot early. 

    creativeopinion_1-1705967229099.png

    Get Item – List A

    Add a Get Item action. Insert an Id of an item from your List A for testing purposes. Ensure it's an ID of an item that al

    creativeopinion_0-1705968495742.png

    Get Items – List B

    Add a Get Items action to your flow to return the list of items from List B. When using the Get Items action—it's more efficient to run it once (get the items from your SP list once) and utilize a Filter Array action.  

    creativeopinion_1-1705968684186.png

     

     

    Get yourself familiar with how to use this action by watching this YT Tutorial: Are you using the Microsoft Power Automate Filter Action wrong?

     

    In this video tutorial I’ll show you 3 practical ways to use the Filter Array action and how to use it properly.

    1️⃣ Cross-Referencing Data

    2️⃣ Filtering by Key

    3️⃣ Substring Matching

     

    Did you know that the Condition action has a limit of 10 conditions? Although it might look like the Filter Array action can only accept one condition—this is not true. By using the advanced mode you can enter multiple conditions into a Filter Array action with an expression.

     

    IN THIS VIDEO:

     3 Ways to Use the Filter Array Action

    How to use the Scope Action to Group Actions

    How to Check the Number of Items returned from a Filter Array Action

    How to Cross-Reference Data in Excel with a SharePoint List

     How the Filter Array Action Works

     How to Access the Dynamic Content from a Filter Array Action

     How to Filter Items by a Key

    How to Filter Items by Matching a Substring

    How to Use Multiple Conditions in a Filter Array Action

     

    ----

     

    However, there seems to be some conflicts in your conditions. 

    Condition 1: Insert Records

    • Logic: If no items are retrieved from List B with the matching Dashboard ID from List A, insert rows into List B with details from List A.

    Condition 2: Delete Records

    • Logic: If a match is found in List B with the matching Dashboard ID from List A, and the Component, Component ID exists on List B but does not exist on List A, delete the row in SharePoint from List B.
    • Potential Issue:
      • This condition might create conflicts with Condition 1. If a Component ID exists in List B but not in List A, it's slated for deletion. However, if new items are added to List A that are not yet in List B (as per Condition 1), they might not get a chance to be inserted before being marked for deletion.
      • The condition assumes that the absence of a Component, Component ID pair in List A while being present in List B is enough reason for deletion. Is this always the case, or should there be more checks?

    Condition 3: Keep Records

    • Logic: If a match is found in List B with the matching Dashboard ID, Component, Component Type from List A, no action is needed.
    • Potential Issue:
      • This seems to be clear, but it doesn't account for any updates that might be needed. What if the details of a Component need to be updated? There should be a condition to handle updates where the ID matches but other details have changed.
      • This condition might overshadow Condition 1. If a new Component in List A does not have a corresponding entry in List B, it should be inserted. However, if the Component Type is also considered, this might complicate the insertion logic.

    Considerations

    • You don't currently have a condition for updating existing records.
    • The conditions are highly dependent on the order of execution. If not managed properly, you might end up deleting items that should be inserted or vice versa.
    • The criteria for matching (Dashboard ID, Component, Component ID, Component Type) need to be very clearly defined and consistent across all conditions to avoid logical conflicts.

    What would help is to better understand what you need is your end goal. It sounds like List B is your master list? As you have additional lists that are like List A. The more information you can provide—the easier it will be to assist.

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response! If you're feeling generous— ️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

  • thecoolcracker Profile Picture
    4 on at

    @creativeopinion Thank you for your time and careful thought and consideration.

     

    I was successfully able to perform get items on LIST B and also from LIST A. Now I need to be able to compare the two lists and perform the desired action.

     

    Sorry, one thing I should have mentioned is that, users have no option to update, these are drop down values from each list. 

     

    I will try and explain the 3 conditions with an example below:

    LIST A

    Dashboard IDComponentComponent Type
    123AppleFruit
    123BananaFruit
    123KiwiFruit
    123SpinachLeafy
    123KaleLeafy

     

    List B

    IDComponentComponent TypeDashboard ID
    45AppleFruit123
    46BananaFruit123
    47GrapesFruit123
    48CarrotRoot123

     

    Condition 1: I am expecting Kiwi, Spinach & Kale to be inserted into LIST B.

    Condition 2: I am expecting Grapes, Carrot to be deleted from LIST B

    Condition 3: I am expecting Apple, Banana to keep in LIST B

     

    Please suggest on how to proceed on the next steps.

     

    Thank you!

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @thecoolcracker How do you plan on triggering your flow? When an item is added to List A? Do items ever get updated on List A? If so—do you not want the corresponding item in List B to also be updated? 

     

    Based on your sample data above—the only way to tell if an item from List A exists in List B is to look for an item where the Component, Component Type and Dashboard ID are a match.

     

    Have you considered storing the unique ID from List A in your List B? It would be a lot more efficient to check to see if an item in List A exists in List B by using a unique identifier.

  • thecoolcracker Profile Picture
    4 on at

    @creativeopinion The flow is triggered 'on change' of the field in LIST A. This is when also an item is added to LIST A. The items do not get updated on LIST A. 

     

    This is a great idea, to add the Unique ID of LIST B into LIST A, but in the flow of events I'm no sure if I can do that. Also, in this case I may not need LIST B. 

     

    If there is a way to loop through the lists and come up with a strategy that'd be great. Please let me know.

     

    Thank you!

     

     

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @thecoolcracker What's your end goal? To have a single list? Are you looking for a way to merge your multiple lists into one? I'm unclear on the why. If you could provide more insight I could offer recommendations.

     

    You mentioned other lists that are like List A that need to be added to List B (unless I misunderstood your requirement).

     

    Also, I don't understand the flow trigger that you plan to use (on change)—unless I'm missing something. If the items don't get updated on List A and you don't need to update List B (you are looking to add/delete only) then your trigger should be When an Item is created—unless I'm missing something.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard