|
|
Documentation Wiki > ExactTarget > Content > AMPscript > How to Use AMPscript to Retrieve Channel Member Names and IDs
How to Use AMPscript to Retrieve Channel Member Names and IDsFrom $1This document contains conceptual and procedural information about using AMPscript to pull back channel member IDs and names from an Enterprise account. PrerequsitesYou must be familiar with AMPscript to use the information in this document. You must also have microsites or landing pages enabled for your account. How to Use AMPscript to Retrieve Channel Member Names and IDsPlace the AMPscript below in a landing page and refresh to page to view the information. Note that you must change the ParentID in the AMPscript to match your parent account and create the data extension necessary to hold the information. %%[
SET @param = RequestParameter("p")
IF @param == 1 THEN
SET @rr = CreateObject("RetrieveRequest")
SetObjectProperty(@rr,"ObjectType","Account")
AddObjectArrayItem(@rr,"Properties","ParentID")
AddObjectArrayItem(@rr,"Properties","PartnerKey")
AddObjectArrayItem(@rr,"Properties","Name")
AddObjectArrayItem(@rr,"Properties","ID")
AddObjectArrayItem(@rr,"Properties","Client.PartnerClientKey")
AddObjectArrayItem(@rr,"Properties","AccountType")
SetObjectProperty(@rr,"QueryAllAccounts",1)
SET @sfp = CreateObject("SimpleFilterPart")
SetObjectProperty(@sfp,"Property","ParentID")
SetObjectProperty(@sfp,"SimpleOperator","equals")
AddObjectArrayItem(@sfp,"Value","InsertYourMIDValueHere")
SetObjectProperty(@rr,"Filter",@sfp)
SET @results = InvokeRetrieve(@rr)
FOR @i = 1 TO RowCount(@results) DO
SET @row = Row(@results,@i)
SET @id = Field(@row,"ID")
SET @name = Field(@row,"Name")
SET @date = NOW()
SET @ud = UpsertData("Query Mapping",1,"ChannelMemberName",@name,"ChannelMemberID",@id,"Date",@date)
NEXT @i
ENDIF
]%%%%=RowCount(@results)=%%
NOTE: Add the string &p=1 to the end of your microsite or landing page when running this AMPscript to prevent the page from being processed by search bots and other similar mechanisms. If you wish to have your page processed, leave the string off of the URL and remove line 3 in the above code. This page was last updated by Ryan Williams on Thu, 22 Mar 2012 15:37:43 GMT. If you require assistance with the ExactTarget application, please contact Global Support. If you wish to send Ryan direct feedback, fill out the form below:
Tags: (Edit tags)
|
Powered by MindTouch 2010 |