on 2022 Sep 18 9:33 PM
Hello,
how to Remove xml nodes with child nodes on CPI.
input
<Lead ActionCode="01"> <Account> <Name1>Yasser Taysser</Name1> <CountryCode>GR</CountryCode> <MobileFormattedNumberDescription>+201116116210</MobileFormattedNumberDescription> </Account> <Campaign> <ID>0000000849</ID> <Version>1</Version> <Name>New Lead Transfer 18.09.2022 - co - copy</Name> </Campaign>
<Contact> <Name1>Name</Name1> <PersonFirstName>First name</PersonFirstName>
</Contact>
</lead>
Expected output (Remove Account section)
<Lead ActionCode="01"> <Campaign> <ID>0000000849</ID> <Version>1</Version> <Name>New Lead Transfer 18.09.2022 - co - copy</Name> </Campaign>
<Contact> <Name1>Name</Name1> <PersonFirstName>First name</PersonFirstName>
</Contact>
</lead>
Request clarification before answering.
Hi
You can solve this using XSLT and the method I described in this blog post: Thinking in XSLT: Filtering XML elements.
In your case, the solution looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:mode on-no-match="shallow-copy" />
<xsl:output method="xml" indent="yes" />
<xsl:template match="/Lead/Account" />
</xsl:stylesheet>
Add this stylesheet in an XSLT mapping step to your iflow, and it will remove the Account element from the payload.
Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.