5

I have an odd bug that I am running into. I will try to explain what we are seeing as best as possible without writing a novel! What we are trying to do is run a bit of AMPscript to add/update a record to a data extension within our instance. When we use the InsertDE function, the subscriber id writes to the mentioned table below (sub_id_reference_prod). This function works fine at time of send.

I then used the @sub_id_update value to make sure something was available to populate if we were to use the upsertde function. This too worked.

Now when I add these components together with the UpsertDe function, the Upsert call does not add subscriber id to the referenced table.

I have tried multiple variations and nothing adds the subscriber id using the upsert function. Is there a limitation with the UpsertDe function that doesn't allow a subscriber id update?

set @subscriberid = subscriberid
set @email_address = emailaddr
set @value = 'true'
set @subkey = SubscriberKey
InsertDE('sub_id_reference_prod','email_address',@email_address, 'subscriberid',@subscriberid)

set @sub_id_count = LookUpRows('sub_id_reference_prod','email_address',@email_address)

if rowcount(@sub_id_count) > 0 then
set @sub_id_update = 

LookUp('sub_id_reference_prod','subscriberid','email_address',@email_address)
UpsertDE('ent.mbusa_contact_master_de',1,'subscriber_key',@subscriberkey,'email_address',@email_address,'subscriberid',@sub_id_update)
endif
  • 1
    I can't see where you are setting the value for @subscriberkey in the upsert function? – Travis Naughton Sep 20 '18 at 22:40
  • Is there an error? Have you verified that it does write to the DE, just not the SubID? I also would remove the new lines separating set @sub_id_update = from the following Lookup() statement. I find that new lines inside of AMPScript variable setting can cause some odd behaviors at times. – Gortonington Sep 21 '18 at 12:45
  • It does write to the DE, but the Sub id isn't there when the update occurs. The new line is a formatting issue with SE. The content block has the function on the same line. – Realrx7 Sep 21 '18 at 20:49
2

You need to set a value for your lookup.

set @lookupvariable = LookUp('sub_id_reference_prod','subscriberid','email_address',@email_address)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.