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

Searching for a record from one data source in another

Not having much luck with this: got 2 data sources from excel.

Want to go through each record in data source1 and look for a matching record in source2

If found, write to that record in both source1 and 2
TimRohr
Level 10

Re: Searching for a record from one data source in another

Do you have a unique identifier to the records? How would you determine "sameness" of the records?

 

With a unique identifier, you can use that as the basis of the logical test for a First(Filter()) construction to get the record from the second list.

 

Another option that I haven't tested... Patch() accepts a record as the starting point... so if you know the data structures of your 2 lists are the same and the fields are all exactly the same... AND you know that the record exists in your second list if it is in your first, I think you can just Patch() the second list, providing the record from the first as the starting point, and then supplying your changes. (According to your description, you would be making the same Patch() statement to the record in the first list, too).

Super User Rank
Super User

Re: Searching for a record from one data source in another

Hi @fless1,

@TimRohr is absolutely correct in his suggestions.  It sounds like you could use some help with understanding the principles behind relational databases.  If you have some time, please review my posts in the Community blog regarding this topic starting with the one titled: Database Design Fundamentals and PowerApps: An Overview

fless1
Level: Powered On

Re: Searching for a record from one data source in another

Thanks all. I’ve managed to resolve on my own by using collect to take a lot of my source then using forall to check records that match the 2nd data source. If so, patch the record in source that matches the record in the copy of source 1