I am creating a workflow to update customer information which is stored in a SPO list. I want to schedule a run every so often and then if the date is greater than (for exaple 365 days) then it emails the contact in one of the columns of that list item.
I seem to have completed it apart from the fact I now get an email to the correct email address (the only one in the list that is older than the required days) but it emails me 3 times. I am guessing its to do with the way the loop is configured. Please see screenshots below
Page 1 / 1
Hi @Andy.Emery
From your screenshot, everything seems to be in order.
Is there any condition set in the “Query a List” action? How many items are returned?
Is the variable “Number of days since last updated” coming from the “Find Interval btw dates”
Is there only 1 email address from the List column?
Perhaps you could add the “Item ID” and “Workflow Instance ID” to the email. Item ID → to verify no other items meet the condition (> 3 days) Workflow Instance ID → to verify no other instances (this is most unlikely)
PM me the export key for your workflow
Hi @Garrett
I actually just fixed it. I moved the run if true and send an email outside of the loop as per below and that was as simple as that, it now only emails me if the date is older than 3 days.
It seems to work ok for now but will test with more data shortly
Thanks for your response
Hi @Andy.Emery
The “Run if True” will only run Zero or One time. If the last item fits the condition (> 3), then it runs ones. Else if the last item doesn’t fit the condition, then it doesn’t run I’m guessing that the last item fits the condition
You can verify this when you have 2 items which fits the condition
@Garrett ah yes you are correct, just tested it with another row that had a date greater than 3 days and it only did it for the last row
@Andy.Emery
The Run-If block has to be inside the Loop for Each block.
Also in your Query a List action, did you set any conditions?
Hi @Garrett
Yes I have moved it back now, but still struggling. No I have not set any conditions yet. Im going to have a play with it now to see if I can work it out
Hi @Andy.Emery
The issue is caused by the “Find interval between dates” action. ISSUE: You are only updating the variable once and this value is used by all items in the for each loop
SOLUTION: Move the “Find interval between dates” action into the Loop For Each. Change the Start Date to “Loop for Each → Current Item → Date Last Updated”
Hi Ya, sorry its still only sending an email for the first item, I have checked and the actual data has 2 items that meet the condition as oer below
Its like its only looking at the first item. I have added the log instance details and count items in list to help me troubleshoot, and it counts 4 items which is correct but it only captures the first company name? I would expect it to bring back all company names no?