We are trying to pass through external variables via an API call that will then assign values within an AMPscript block to populate a triggered SMS communication. All the API calls are ending up in the error queue at the moment.Here's what we have in place now:

        Var @HOHID, @ClinicID, @curTime, @CancellationCodeEnglish, @CancellationCodeSpanish
        Set @ClinicID = %%ClinicId%%
        Set @HOHID = %%HOHId%%
        Set @ReasonCode = %%CancellationReasonCode%%
        Set @FriendlyClinicName = Lookup("ll_clinic_data","FacilityName","CRMFacilityID”,@ClinicID)
        Set @CancellationCodeEnglish = Lookup(“Cancellation_Reason_Codes”,"ReasonCode_English","CancellationReasonCode”,@ReasonCode)
        Set @CancellationCodeSpanish = Lookup(“Cancellation_Reason_Codes”,"ReasonCode_Spanish","CancellationReasonCode”,@ReasonCode)
        Set @MsgLanguage = Lookup("b_patient_data","Language","HOHid",@HOHID)

        IF @MsgLanguage == "English"    
        Set @msg = “Your %%[%%= v(@FriendlyClinicName) =%%]%% office is closed due to %%[%%= v(@CancellationCodeEnglish) =%%]%%. Someone will call you to reschedule."
        Set @msg = “Su %%[%%= v(@FriendlyClinicName) =%%]%% está %%[%%= v(@CancellationCodeSpanish) =%%]%%. Alguien le llamará para una nueva cita."
        %%= v(@msg) =%%

Here is the snipped where we are creating the attribute (done in a loop):

                subscriber.Attributes[attributeIndex] = new ExactTargetAPI.Attribute();
                subscriber.Attributes[attributeIndex].Name = dc.ColumnName;
                subscriber.Attributes[attributeIndex].Value = subscriberData[dc.ColumnName].ToString();
  • You have opening and closing script blocks within the main script block, this will error. You will need to remove the %% around ClinicId for example. – victorcorey Oct 21 '14 at 17:17
  • @victorcorey we are using those opening/closing script blocks as the pointer for the API call. THose variables are being passed in externally. Will the API call know to associate the parameter with those removed? – Realrx7 Oct 21 '14 at 17:57
  • What is the API call? Here's an example for a Triggered Send API call. The external data is being passed in a parameter called xml. help.exacttarget.com/en-US/documentation/exacttarget/content/… – victorcorey Oct 22 '14 at 18:26
  • So I think what you are looking to do is: Set @ClinicID = ClinicId – victorcorey Oct 22 '14 at 18:30

Couple of updates to make this work:

  • Removed the '%%' characters from the set statement

  • Removed the 'Your %%[%%= v(@FriendlyClinicName) =%%]%%'... portions and replaced with concat @msg

  • The Spanish version would not allow specific characters to be used in mobile (I.E. the accent symbols)

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.