[SalesForce] Emails being queued in a Journey Builder interaction

I have a Journey Builder Interaction in which after a decision split, I am sending 2 emails one after the other without wait. The issue is that:

The 1st Email is not taking any subscribers,

The 2nd Email is taking all subscribers that passed through the decision split.

When I check the Send section for that Journey Builder email, I see:

4,478 Emails are Queued and 17 have Errored.

I have already check the Email for Content Detective and Validation; both passed. Also journey is running fine.

Is there anything else that can be checked for email or journey? Or a way to check why the emails are queued for that email only?

UPDATE

I have this AMPScript in the email which is failing:

UpsertDE("Account Updates", 1, "EventinstanceId", EventinstanceId, "Journey Status", Now())   

Below is the error i am getting on that – Got it from SFMC support

Pls advise on error as i am unable to understand

Sql Text:
UPDATE [C7215610].[Account Updates] SET [Journey Status] = @p0_0 
WHERE [EventinstanceId] = @p0_1;
IF @@ROWCOUNT = 0
 INSERT INTO [C7215610].[Account Updates] ([EventinstanceId],[Journey Status])
  VALUES (@p0_2,@p0_3);

Sql Parameters:
  0: [NVarChar] @p0_0 = 10/18/2016 5:57:46 AM
  1: [NVarChar] @p0_1 = 1ede7fb6-bea0-4415-87d1-5f04d87d7ee3
  2: [NVarChar] @p0_2 = 1ede7fb6-bea0-4415-87d1-5f04d87d7ee3
  3: [NVarChar] @p0_3 = 10/18/2016 5:57:46 AM

  Error Code: DE_BATCH_UPDATE_ERR
 - from OMMCommon --> 

 --- inner exception 1---

System.Data.SqlClient.SqlException:  

Error[0]:  -- Number: 515 Class: 16 State: 2 Source: .Net SqlClient Data Provider Server: XTGAP4CL12D6.XT.LOCAL\I6,10006 Line: 4
   Message: Cannot insert the value NULL into column 'CustomerId', table 'ExactTarget752.C7215610.Account Updates'; column does not allow nulls. INSERT fails. 

Error[1]:  -- Number: 3621 Class: 0 State: 0 Source: .Net SqlClient Data Provider Server: XTGAP4CL12D6.XT.LOCAL\I6,10006 Line: 4
   Message: The statement has been terminated.

 - from .Net SqlClient Data Provider

I am unable to understand that in UpsertDE, we are updating Account Updates DE then why the error is mentioning CustomerId column

Cannot insert the value NULL into column 'CustomerId'

Best Answer

Emails configured in Journey Builder are Triggered Sends, which you can find in the Interactions tab in SFMC.

You can pause the trigger corresponding to your email and download the queued subscribers or clear the queue. You can also pause and restart the trigger definition in case one email is holding up the queue.

I'm guessing there's some issue with the data coming over in the payload that isn't handled in the email scripting.

Edit

I'd revise your AMPScript to make it more fault-tolerant and to include the CustomerID which is required in the DE you're updating:

%%[

var @eid, @js, @cid

set @eid = AttributeValue("EventInstanceId")
set @cid = AttributeValue("CustomerId")

if empty(@cid) then
  set @cid = "0"
endif

set @js = now()

UpsertDE("Account Updates", 1, "EventInstanceId", @eid , "CustomerID", @cid, "Journey Status", @js) 

]%%

It's a good practice to code your email assuming that any of the incoming values can be null. The AttributeValue() function will return an empty string if the personalization string is undefined.

Related Topic