cancel
Showing results for 
Search instead for 
Did you mean: 

retrieve attachmentId from payload response

pedrocosta
Explorer
0 Kudos
439

Hi

I have posted an attachment into SuccessFactors and I receive the below response:

now, to assign the attachment to a custom Mdf object, I would like to store the attachmentId as a property in a content modifier, however, the xml response I receive is actually unworkable, mostly because the highest level node has the namespacing with all those special characters, so navigation is not possible from that point

also, the field attachmentId is actually as below as well (with special characters)

<d:attachmentId m:type="Edm.Int64">2414</d:attachmentId>

how can I achieve this?

any help would be really appreciated

thank you

Accepted Solutions (1)

Accepted Solutions (1)

MortenWittrock
SAP Mentor
SAP Mentor
0 Kudos

Hi Pedro

There's nothing wrong with your XML. And yes, your issue probably has to do with namespaces. In order to use them in an XPath expression, you need to declare them first. Go to your iflow's Runtime Configuration tab (click the iflow canvas, i.e. the background) and add the following to the Namespace Mapping field:

xmlns:n=http://www.w3.org/2005/Atom;xmlns:m=http://schemas.microsoft.com/ado/2007/08/dataservices/metadata;xmlns:d=http://schemas.microsoft.com/ado/2007/08/dataservices

It should look like this when you're done:

Now create a property with Source Type set to XPath and the value set to:

/n:entry/n:content/m:properties/d:attachmentId

Like this:

After this Content Modifier step, the property contains the correct attachment ID.

Regards,

Morten

pedrocosta
Explorer

Hi, you are an absolute star as always, the solution you provided indeed worked and it made me feel quite silly as I had tried a similar approach, but I had the content modifier syntax written incorrectly, so I dismissed it completely.

thank you very much for your help

Best Regards

Pedro Costa

MortenWittrock
SAP Mentor
SAP Mentor
0 Kudos

Thank you for the kind words, pedro290883. Glad to hear you got it working.

Regards,

Morten

Answers (0)