Hey Team,
I have a flow that is as follows:
When a response is submitted (MS Form) > Get response details > List rows present in a table > Filter array > Condition > If Yes add row to a table > If no send an email
The filter array should assess whether StakeholderEmailAddress AND DateofEngagement match existing data in the excel table called Automate - if there is a match with both columns then the flow should follow the No branch and send an email.
If there is no match then the flow should follow the yes branch and add a row to the table with the response details. This is to avoid duplicate entries.
The filter array I am using is:
@and(
equals(item()?['StakeHolderEmailAddress'], triggerOutputs()?['body/StakeHolderEmailAddress']),
equals(item()?['DateofEngagement'], triggerOutputs()?['body/DateofEngagement'])
)
The flow runs successfully every time but it duplicates an entry every time even if the StakeholderEmailAddress and the DateofEngagement are entered as matching values on the MS Form each time.
The condition I am using is:
empty(body('Filter_array'))
is equal to true (entered as an expression)
Can anyone assist with why the filter array is not identifying the matching entries and following the No branch, but adding a duplicate row each time?
For clarity if the StakeHolderEmailAddress matches but the DateofEngagement doesn't then a new row should be added - this is because we want to capture whether the same stakeholders have been engaged with on different dates; the only time a row should not be added is if the two columns data match.