Hello,
My trigger is Business central (BC) and when an record is changed, then I Get the record from BC. step 3 I get the items from a SharePoint (SP) list. then i have a condition to check if the title in SP is equal to the ID from BC. if yes, it updates the existing record. if no, a new record is created.
Now, as you know that the apply to each is used because of get items. so for each condition that outputs a 'no', a new item is created because only one ID from business central is checked with each items in SP.
how do i get this to work so it creates only when the item doesnt exist at all? as a work around I can have 2 flows, one to create and one to update, but really want to have just one so less number of flows are created and managed. any suggestions?
I tried odata filter in get items but not sure how to get it to work. kinda followed this
any help will be greatly appreciated
Solved! Go to Solution.
This is fixed by adding a filter query on 'get items' followed by a condition which compares the length of get items to '0' (zero). if '0' creates an item, if not zero, updates the item.
Hello,
Instead of using the Condition Control use the switch Control as shown bellow.
-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a 👍
@zbenhallam Thank you for the quick response. I can see that this will work, but how do I add a dynamic content for the case condition?
This is fixed by adding a filter query on 'get items' followed by a condition which compares the length of get items to '0' (zero). if '0' creates an item, if not zero, updates the item.