4

From MobileConnect, I have initiated a SMS send and a text response for the same.

Both are working fine.

I am able to send a text response which gets handled by my AMPscript shown below.

%%[
var @result, @response, @cusresponse, @sfcreate, @upsertres
set @cusresponse = [MSG(0).NOUNS]
set @result = Lookup("RespTest","Responded","SubscriberKey",MOBILE_NUMBER)
if @result == "Y"
    set @response = "We have already received your response earlier. Thanks"
else
     set @response = "Thanks for your response"
     set @upsertres = UpsertData('RespTest', 1, 'Phone', MOBILE_NUMBER, 'Responded', 'Y')
     set @sfcreate = CreateSalesforceObject("CusResponse__c",1,"Resp__c",@cusresponse)
endif
]%%
%%=v(@response)=%%

This AMPscript basically checks for existing response

  • if there is any existing response then it informs the user that they have already responded.

  • if there is no existing response, then it records the response in the data extension and creates a record in SF using CreateSalesforceObject call

The entire process is working as expected with one issue

As seen in the image below

when I sent a first response (shown in blue) "Thanks" as response to the SMS, the process works as expected.

when I sent a second response (shown in red below) "No Problem" immediately after Response 1 , I keep getting this "There was an error processing your message"

Can someone let me know whether this is the expected behaviour ?

enter image description here

2
  • 2
    How is next keyword configured for the text response?
    – EazyE
    Commented Nov 28, 2023 at 3:35
  • I have not configured NEXT keyword which explains. You can mention this as answer.Thanks.
    – Endless
    Commented Nov 28, 2023 at 6:35

1 Answer 1

2

Each message would need a next keyword configured to handle conversations like this.

You could also create ampscript in your default keyword message to handle comments not assigned to a keyword

You must log in to answer this question.

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