0

I'm trying to retrieve Mobile List attribute using ampscript in Mobile Push Message and trying to insert a row based on that information in Data Extension.

But when I try to send message, it gets failed. Below code I'm using in Mobile Push Outbound message.

%%[

var @ContactKey = AttributeValue("Contact Key")
var @MobileNumber = AttributeValue("Mobile Number")
var @DeviceID = AttributeValue("Device ID")
var @Source = AttributeValue("Source")
var @Channel = AttributeValue("Channel")

set @insert= InsertData('POC_Geofence', 'ContactKey', @ContactKey, 'MobileNumber', @MobileNumber, 'DeviceID', @DeviceID, 'Source', @Source, 'Channel', @Channel, 'Geofence', 'False')

]%%
Contact Key : %%=v(@ContactKey)=%%

2 Answers 2

2

The var should be set.

%%[

set @ContactKey = AttributeValue("Contact Key")
set @MobileNumber = AttributeValue("Mobile Number")
set @DeviceID = AttributeValue("Device ID")
set @Source = AttributeValue("Source")
set @Channel = AttributeValue("Channel")

set @insert= InsertData('POC_Geofence', 'ContactKey', @ContactKey, 'MobileNumber', @MobileNumber, 'DeviceID', @DeviceID, 'Source', @Source, 'Channel', @Channel, 'Geofence', 'False')

]%%
1
  • Hi @Adam Spriggs - Thanks for the answer, that' really silly me :P. This worked for me, but I'm not able to retrieve the Contact Key and Mobile Number from Mobile List which is a filtered list created from Mobile Push Channel. Any idea how to retrieve that?
    – darkCloud
    Commented Jul 13, 2022 at 12:58
1

You can use the set @ContactKey = AttributeValue("Subscriberkey") to fetch the contactkey from the mobile list.

You must log in to answer this question.

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