Hi All,
I'm trying to pull records from Salesforce (trigger when record modified) and add them to a SharePoint list. In general, this works, but I also need to check to see if the record has previously been added to the list and Update it if already exists.
So when the Salesforce trigger runs, I use Get Items to get the records on the SP list. Since the record may or may not exist on the SP list, I use a filter query to compare the Salesforce AccountID field of items on the SP list to the current record being modified. I then use a Condition to check to see if the AccountID field from the Get Items comes back empty (no match).
This works as long as there is an existing record on the SP list that matches up. Then the Condition goes down the No branch (AccountID is not empty) and the Update part works fine. But if the record doesn't already exist on the SP list, now then the output of the Get Items is empty, but the Condition still chooses the No branch.
I've tried setting the Condition to check for null and I've also tried checking for "empty" using each of the following expressions:
@equals(items('Apply_to_each')?['SF_x0020_Account_x0020_ID'], null)
@empty(items('Apply_to_each')?['SF_x0020_Account_x0020_ID'])
Neither one seems to work. Any suggestions?
Here's a screen shot of the flow as it is now:
