1

I found a piece of code in our cloud that was written by someone in the past, and I don't know what it does (I have no developer experience).

%%[
    if Not Empty(@zip)
        Set @rows = LookupRows("ShipTimes", "zip", @zip)

        if RowCount(@rows) == 1 then
           set @row = row(rows,1)
           set @city = Field(@row, "city")
           set @state = Field(@row, "state")
        endif
    endif
]%% 

and another one:

SELECT
    l.ListName,
    de.SUBKey,
    l.[Status]
from
    [<de_name>] de
Join
    [_listsubscribers] l 
ON
    de.SubscriberKey = l.Subscriberkey
where
    l.listname = '<List name>'

Do any of you have any idea what are the codes supposed to do?

4

The AMPscript-code checks if the variable "zip" isn't empty, and if so, it checks the "ShipTimes" data extension for that zip-value. If there is only one match, the values for "city" and "state" from the retrieved row are written to the corresponding AMPscript-variables.

The SQL statement retrieves the ListName and Status from the ListSubscribers-Data View for all subscribers, that exist in the data extension <de_name> and on the list <List name>. Additionally the SUBKey-column is added from <de_name>. The matching between the data extension and the data view is done via the Column "SubscriberKey".

Additional Information:

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.