0
AMPSCRIPT:

%%[
    var @subkey, @availuser
    set @subkey = AttributeValue("_subscriberkey")

    SET @EArows = LookupRows("_Subscribers","SubscriberKey","mycenter+10@gmail.com")

    IF ROWCOUNT(@status) != 0 THEN
        SET @availuser = 'The subscriber is available'
    ELSE
        SET @availuser = 'The subscriber is not available'
    ENDIF
]%%

SSJS:

     var listsofall =     List.Retrieve({Property:"Name",SimpleOperator:"equals",Value:"All Subscribers"}); 
     var listKey2 = listsofall [0].CustomerKey;
     var myList2 = List.Init(listKey);

Hello,

The objective of this work is that we want to check the subscribers availability in all subscribers list and we tried with the AMP SCRIPT and SSJS it's not working. please have look on the above code that we have implemented and share your suggestions.

Thanks in advance.

0

All Subscribers is referenced through the 'Subscribers' object in SMC, not a data extension.

Something like this:

var results = Subscriber.Retrieve({Property:"SubscriberKey",SimpleOperator:"equals",
Value:"MySubscriberKey"});

Something like this is generally easier in ssjs than ampscript. Though, if your use case is email, ssjs is not best practice. Landing pages or script activities are where ssjs should live.

Wiki: https://help.exacttarget.com/en-GB/documentation/exacttarget/content/server_side_javascript/server_side_javascript_syntax_guide/core_library_server_side_javascript_functions/subscriber_server_side_javascript_library/

| improve this answer | |
  • What is the results format? How to iterate through the results? @David Jackman – sfdcFanBoy Sep 17 '18 at 11:07

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.