Compare a table with master table and find uncommon rows

Hi Guys, I am trying to automate adding items to a SharePoint List.
I have 2 tables. 1 Master (dtMaster) and 1 with new data (dtNewData). The requirement is
that the dtNewData should get compared to dtMaster, and only the uncommon rows should remain. These rows will then be added to a SharePoint List as new items.

The dtMaster has only one column. dtNewData has 11 columns. The primary key for both tables is the 1st column.
dtNewData is read from an excel range (excel table). dtMaster is created by extracting structured data from a webpage.

I found a solution on the forum. When I put sample data into the attached flow, it works. But when I plug this flow into my main sequence, it just gives me a table with no rows.

Find_Common_NonCommon_By1Col_Test.xaml (16.4 KB)

@Achal_Desai
Welcome to the forum

your XAMl was running and was also implementing the defensive check for empty result.

Can you eleaborate more on the issue related to the real data checks?
Had you checked if datatable with extracted structured data from a webpage is not empty?

Thanks

Hi Peter,
Thanks for the quick response. I realize now that the flow I used is yours from another post.
Like I said, when I plug in data from the build tables, the flow works.
But when I use the flow in my main sequence, and replace the 2 tables, I get an empty table as the result.
From the screenshot below, you can see that the dtNewData has 3 rows and dtMaster has 502 rows. But the resultant table has no rows.

Could the data type in the joining columns be causing problems? The join is happening on a number (600xxxxxx). One table could be string and the other could be int?
I did check with get type and both returned System.String though.

First analysis what we can do is number matching check
CommonRows + UnCommonRows Counts = has to be TableRowsCount

If numbers are matching then we can check, if compare is failling eg.
But also check if Master / Data / Common is not swapped when doing the uncommon rows retrieval

If possible may you share your XAML with us

Hi Peter,
I think I solved it. I was worried that there would be a data type mismatch on the primary key column. So I was converting the column to string. That is where something was going wrong.

I extracted the flow of data comparison to upload here for you guys to review.
And just as an experiment, I tried removing the conversion to string part and ran on a small data set.
And it worked right away.

I will try it next week again with a larger (more realistic dataset) and confirm that it works as well.

But thank you very much for taking the time to review and reply.

And it was your original post that I got the solution from in the 1st place to thanks for that as well!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.