I’m having TN invoke a service which starts out grabbing the sender/ProfileID and passing that to ‘getProfile’ service so I can get 1 of the ExternalID’s for the sender.
when I run it, it gets the Profile, but only the ‘Corporate’ sub-element comes back as a document. the ‘Contact’, ‘Delivery’, and ‘ID’ all come back as object lists. when I look at those object lists, they look like the documents, but they’re not being recognized as those document types, so I can’t map the Profile/ExternalID/ExternalID to the input I need to.
anyone know why these are being treated as objects instead of documents?
You can “unwrap” the document list with the pub.list:appendToDocumentList service.
Create a new flow service.
Service Input variables:
id:String
idTypeDesc:String
Service Output:
contacts:Document Reference List for wm.tn.rec:Contact
Add a flow step.
wm.tn.profile:getInternalID
Add a flow step.
wm.tn.profile:getProfile
Add a flow step.
pub.list:appendToDocumentList
flow step in map fromList = profile/Contact
flow step out map toList to the contacts service out variable you created in the first step.
When you run this service supply an external id and type for the service input, ie. 123456789 and DUNS.
You will see the list of contacts in the results.
To work with the contact list within this service, “push-pin” a contacts document reference list to the output side of a map step and use appendToDocumentList as a transformer to load it.
Call wm.tn.profile:getExternalID
Pass sender/ProfileID as the partnerID
Pass the name of the external ID type you’re after, such as “Mutually Defined” or “DUNS” or whichever type you’re interested in.
You’ll get back the external ID if it exists. Be aware that that the returned “id” will be $null if not defined in the profile.