I'm trying to craft a Flow that really should be simple, but I'm struggling.
Basically I want SP1 to update SP2 only if a particular item (Course Title) is not in the SP2.
Currently, I'm performing this with the below:
Where my SPL1 (Create) is:
And my SP2 is:
The problem I am witnessing is this:
If I create an item in SP1 where course title is "Introduction to Marketing" as an example, the Flow goes to check if "Introduction to Marketing" is listed in SP2 as it should. As intended, it sees that it is not there and populates SP2 with "Introduction to Marketing". The first run through in the Apply to Each creates "Introduction to Marketing" and places it beneath the last entry (Media Relations as shown above). However, the Flow then continues in the Apply to Each loop and checks again to see if "Introduction to Marketing" is in the list. I assume it is now comparing with "Cost Accounting" which is the second entry in the list. The Flow realizes that "Introduction to Marketing" does not equal "Cost Accounting" and therefor creates another "Introduction to Marketing" beneath the last and newly created "Introduction to Marketing" from the first run through.
Basically I want the flow to search the entire list to see if "Introduction to Marketing" is in the list, if it is not add 1 entry of "Introduction to Marketing". Or, to explain it differently, I want my Flow to stop when a new item is created in SP2, and not run through the entire Apply to Each cycle.
With the current Flow above, I run it, and end up with 6 entries of "Introduction to Marketing". Because, as I suspect, it compares "Introduction to Marketing" to each line item (6 line items), and realizes that none of them are Introduction to Marketing, and therefor creates 6 entries in SP2.
Can someone tell me how to ensure only 1 entry occurs in the SP2 if it is not in the list?
Any help would be greatly appreciated.
Thanks,
Tom
Solved! Go to Solution.
Hi @tomgardzinski,
I have made a test on my side and please take a try with the following workaround:
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hi @tomgardzinski,
I have made a test on my side and please take a try with the following workaround:
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hi Kris,
It worked! At first it wasn't working because I had the filter query in the "Get Item" set to a value, I cleared that. Then I also had to move the condition statement outside of the "Apply to Each" statement.
Thank you so much for your help. I can see how putting my data into an array will help me going forward.
Tom
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
71 | |
27 | |
22 | |
15 | |
13 |
User | Count |
---|---|
136 | |
43 | |
42 | |
35 | |
31 |