Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Send email only once based on criteria

RDF25087
8 - Asteroid

Hi all -

 

I really don't know where to start with this one...

 

I have a list of customers, their contact details, the account managers details, the sales target for that company and how many sales they have done to date, for example:

 

Company NameContact First NameContact SurnameCustomer EmailA/C Manager EmailAgreement No.Sales TargetCurrent Sales
Fred's FridgesFredMcFridgeoffice@fredsfridges.comJohn Smith5102874300102
Daisy's DishwashersDaisyCleanoffice@ddishwashers.comMichael Caine5108892500490
Herman's HooversHermanSchmidthello@hermansucks.comJohn Smith5103877150146
Wayne's WhisksWayneRooneywayne@thewhiskcompany.bizSarah Davies5100871100042
Maria's MicrowavesMariaGammamaria@heatsitquick.comMichael Caine5147980600587

 

What I need is a workflow that will do the following, when ran:

 

If the Current Sales value is higher than 90% of the Sales Target then it will send an email to the customer and the account manager letting them know they have achieved more than 90% of their sales target on the Agreement No.

 

However, when I run the workflow again I don't want the customer being sent another email - they should only be told once that they have hit the target.

 

So, in the example above:

 

1. Daisy and Michael would be sent an email informing them they have hit the 90% target on Agreement 5108892.

2. Herman and John would be sent an email informing them they have hit 90% target on Agreement 5103877.

3. Maria and Michael would be sent an email informing them they have hit 90% target on Agreement 5147980.

4. There would be no emails regarding Fred or Wayne who haven't hit target yet.

5. The next time I run the workflow no emails would go to Daisy, Herman or Maria again.

 

Clear as mud?

 

Any help would be gratefully received - this is well beyond my current abilities in Alteryx!

RDF

5 REPLIES 5
RDF25087
8 - Asteroid

Apologies - I should have put email addresses instead of names for the account managers in the example above.

 

Felipe_Ribeir0
16 - Nebula

Hi @RDF25087 

 

I believe that you could use a logic like this:

 

1 execution

-Your sent_emails.yxdb table is empty

-You gonna send all emails with [Current Sales] >= 0.9*[Sales Target]
-You gonna write the sent emails into the sent_emails.yxdb 

2 execution
-The left join will let just emails that werent send on the 1 execution to pass

 

Felipe_Ribeir0_0-1675345561497.png

 

RDF25087
8 - Asteroid

@Felipe_Ribeir0  thank you for your response.

 

I'm probably doing something daft, but I get an error on the sent_emails.yxdb output saying "the process cannot access the file because it is being used by another process (32).

 

??

 

RDF

Felipe_Ribeir0
16 - Nebula

Hi @RDF25087 

 

This usually happen when 2 different resources are trying to access the file together. You are not trying to run the workflow with the file open, right? If not, try to use the block until done tool to be sure that the input/output file is being accessed on different times.

 

Felipe_Ribeir0_0-1675430175818.png

 

RDF25087
8 - Asteroid

Thank you @Felipe_Ribeir0 - that seems to have done the trick!

RDF

Labels