I'm creating a flow which takes the entries from List A (Power BI report) and populates List B (SPO list), but only if the list item does not already exist on List B. On both lists there a is an 'ID' column which is always unique.
In my flow I have queried both lists:
In 'Select - GUIDs', I map the ID column value to a key named 'GUID'.
After the above, the outputs from the 'Parse JSON - First table rows' are in a 'For each'. Within this, a new item is created in List B.
Before doing this however, I'm trying to apply some logic to ensure it does not create an entry which is already there. I tried doing this by setting a condition with the following expression:
Select - GUIDs does not contain For each ID column
However for each instance of the flow, the expression keeps evaluating to true and it keeps creating duplicate items. I've also tried adding in a 'Compose and using the 'Contains' function, but it always comes out the same.
Can anyone advise what I'm doing wrong here? Also, if there is a better/more efficient approach to doing this? The reason I've tried doing it this way is because I thought it would be more efficient than querying the SPO list each time in the 'For each'.
Thanks