0

We manage our audience on multiple data extensions and I'm trying to update them via UpdateDE on a cloudpage. One of our data extensions needs another filter besides email address and I can't seem to get the UpdateDE function to work with multiple column filters. Sample of what current implementation looks like below,

%%[
SET @b = 'A'
Set @em = AttributeValue('emailaddr')
  IF NOT EMPTY(@email) THEN
     Set @status = UpdateDE('DE_1',1,'EmailAddress',@em,'OptIn',0)
     Set @status2 = UpdateDE('DE_2',2,'email',@em, 'b', @b, 'opt_in',0)
  ENDIF
]%%

Would appreciate any help as I'm just starting out on Ampscript. p.s. how do people 'run' Ampscript without browsing a page? is there like a JSLint for Ampscript somewhere?

Thanks!

1 Answer 1

2

The main thing you need to be aware of here is the difference between the UpdateDE and UpdateData functions:

  • UpdateDE: Only works in email messages
  • UpdateData: Only works with landing pages and SMS messages

Read the documentation carefully for how to use correctly. It looks like your code should work if you use the correct function.

Best advice that I have for someone new to Ampscript is read the documentation carefully and have it handy to reference. There's also the Ampsript Guide, in which there is a "Best practices" section that you might find useful.

1
  • Thanks for the tip Josh. I just want to clarify that I have tested with both UpdateDE and UpdateData functions, they both won't update the row-column with the value I want if I use more than 1 'where' filter. I've also seen Ampscript Guide, unfortunately the example they have with the multi-column filter is behind the paywall and I'm not yet ready to pay for it as I don't know how much I'm going to need to dabble in Ampscript yet.
    – Jesse
    Commented Jan 30, 2020 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .