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 / Lookup one value in li...
Power Automate
Unanswered

Lookup one value in list against another

(0) ShareShare
ReportReport
Posted on by 792
look at Hi Community
 
I have a situation where I'm trying to create a flow that checks through one list of items against another list.
 
The first list of data is collected from running a query against a dataset (Power BI) and the second list is a SP list. I want it then to add the item from the Power BI Dataset to the SP list if it doesn’t already exist. So really need to look at the items in the Power Bi data and check it against those in the SP list.
 
What is the best way of creating a flow that meets this criteria.
 
Categories:
I have the same question (0)
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at
    What is the common id, key or foreign key on both sets of data? 
  • Kmayes Profile Picture
    792 on at
    @DJ_Jamba There is a Ticket ID on both sides
  • Suggested answer
    DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at
    OK, so you already have the data from Power BI in one action (Parse JSON) and the data from SharePoint in another action (Get items).

    1. After the Get Items action, add a Select action, switch to Map text input mode and configure as follows:
     

     
    From:
    
    @{outputs('Get_items')?['body/value']}
    
    Map:
    
    @item()?['Ticket ID']
     
     
    2. Add a Filter array action and configure as follows:
     
     
    From:
    
    @body('Parse_JSON')
    
    Filter (edit in advanced mode):
    
    @not(contains(body('Select_SharePoint_Ticket_Id_only'), item()?['Ticket ID']))


    This will result in all Power BI rows where the Ticket ID does not exist in your SharePoint list
  • Kmayes Profile Picture
    792 on at
    @DJ_Jamba Im not sure if im being daft or done something wrong but there seems to be alot of items which makes me think it has collected all items that are on the SP list  as I would only expect a few items
  • w.p Profile Picture
    8,339 Super User 2025 Season 2 on at
    If you follow DJ_Jamba's instructions, it should work.
  • Kmayes Profile Picture
    792 on at
     
    I have followed the instructions @DJ_Jamba kindly provided however the amount of items it has returned is the tota amount in the PBI data. After the data I added in an append to array to see what items its picking up in the filter element and its 501 items which is the grand total of items. Either its not filtering correctly or I have put an element incorrect so I have attached a copy below to show
     
  • w.p Profile Picture
    8,339 Super User 2025 Season 2 on at
    are able you to show sample data from the select output and the ticket ID from the parsed JSON?
  • Kmayes Profile Picture
    792 on at
     
    Sure! This is from the select output
     
    And this is a sample from the parsed JSON
  • Suggested answer
    w.p Profile Picture
    8,339 Super User 2025 Season 2 on at
    @not(contains(body('Select_SharePoint_Ticket_Id_only'), item()?['MIGRATED REVENUE C4C[TICKET_ID]']))
  • Kmayes Profile Picture
    792 on at
     
    When I put this code I now get this error message 
     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard