Hi
@Patti Oaks,
Sounds good! Also, while I haven't used it I think you'll want the custom data action to hit up this endpoint to get the contact:
GET /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}
and then pick off the information it wants from the response. Lets assume your custom data action takes inputs of contact ID and contact list ID and for outputs it has a contact name string and contact instructions string. This is "happy path" coding in Architect but shows calling your data action and then sending a response to the contact along with the instructions from the contact:
That expression for the response can be written directly as:
Append(
"Dear ", State.ContactName,
", here are your instructions: ", State.ContactInstructions,
". If you have any other questions or just want to say hi ;-), please contact us. Thanks!"
)
Or instead of selecting Expression for the Body setting on the Send Response action, you could use the String Builder and configure it like this where each part of the response is laid out individually. Some flow authors like this UI better than writing the actual expression text like I have above:
Hope this helps!
Jim
------------------------------
Jim Ullyot
Genesys
------------------------------
Original Message:
Sent: 09-10-2020 16:54
From: Patricia Oaks
Subject: Use an outbound contact list column in inbound SMS flow
Thanks Jim! I will take a look at the data actions.
I would assume in the data action we can use the contact list and contact id to lookup information that was in the outbound contact list for this contact?
When the patient responds, we want to text instructions that were with the original outbound contact.
------------------------------
Patricia Oaks
Electroline Data Communications Inc
Original Message:
Sent: 09-09-2020 11:03
From: Jim Ullyot
Subject: Use an outbound contact list column in inbound SMS flow
Hi @Patti Oaks,
Thanks for the question!
Within an Inbound Message flow, Architect has the following flow level built in variables available:
* Message.ContactId
* Message.ContactList
To see if a contact identifier is set, you could add a Decision action and then create a custom Data Action that would update your contact list contact as appropriate which you could do like this:
Above we used this expression:
!IsNotSetOrEmpty(Message.ContactId)
But if you wanted to check to make sure both the contact ID and the contact list ID are not blank prior to calling a Data Action because you want to pass both in and make sure they're not blank ahead of time, this expression would work:
!IsNotSetOrEmpty(Message.ContactId) and IsSet(Message.Campaign) and !IsNotSetOrEmpty(Message.Campaign.id)
and same thing here where you'd put your custom data action in the Yes output of the Decision action to update the contact list contact. The IsSet check on built-in Message.Campaign variable in the expression above is to be safe because you don't want to attempt to access Message.Campaign.id if Message.Campaign itself is NOT_SET. If Message.Campain is NOT_SET and you try to access the id property on it, that goes on the non-cool list and would invoke flow error handling so that's why I've got that IsSet(Message.Campaign) check there first.
As far as built in flow level variables in Architect, we have this page in the Resource Center that goes over them in more detail:
https://help.mypurecloud.com/articles/architect-default-variables/
So in a nutshell you can check the built in variables to see if you have a contact id / contact list available and then call a custom data action that you'd write to update the contact itself. Architect currently does not have any built in actions to update contact list contacts which is why the Data Action is recommended to do this additional work.
Thanks!
Jim
------------------------------
Jim Ullyot
Genesys
Original Message:
Sent: 09-08-2020 15:01
From: Patricia Oaks
Subject: Use an outbound contact list column in inbound SMS flow
We are sending outbound SMS messages via outbound campaigns for appointment reminders. We allow the person to respond 1 or 2 to confirm or cancel their appointment.
I have set up my inbound SMS flow in architect to process the response, how do I access/associate the contact list from the outbound reminder with the inbound flow so that I can access the appointment information that was sent to the person? On the outbound contact list we have an appointment id associated with each text and I need to be able to retrieve the id when the person responds with 1 or 2 to update our appointments. I am seeing campaign and contact attributes on the message but nothing that gives me the contact list fields.
#Outbound
------------------------------
Patricia Oaks
Electroline Data Communications Inc
------------------------------