There can be ‘N’ number of ways to look at a problem and equally number of ways to solve but we provide the best tip to minimize your debugging efforts to solve it faster.

How do we map an incoming XML element which has mixed content i.e attributes with text content?

Let’s understand the issue in details. If you look at below example of a service response, just find the difference between _VendorName element vs _Currency. One is simple element with text and another one is mixed complex type with inline text content.

If you look at the generated XML-Parse rule (By OOTB integration wizard) you can notice the mapping as below.

Once you run this data page or source rule, you find that  _Currency element is mapped correctly but not _VendorName element.

Now look at _VendorName element at runtime and find its value missing.

Why do you think the data isn’t mapped correctly?

It’s Pega OOTB way to Look at It…

Whenever there is a complex element type, Pega generates element as Page and its attributes as properties inside the page. Here VendorName is created as a Page and its attributes as Properties as shown in above mapping picture.

As it’s a mixed type element, Pega don’t read the element value (“AA APPAREL”) as Page don’t contain any values except properties.  Please have a look at below.

How do we solve it quickly?

As we said, there could be many number of ways to solve it by known or unknown methods or we can argue that the response XML isn’t proper, etc but If we need to address this quickly, then use some basic property(.pyLabel) or create a simple property called (‘Value’ ) and map it in the above highlighted box.

You will see the result as below once you map.

Hope this helps you when you come across this situation. Please share you own approach if you have come across in the below comments section.

Leave a comment

I’m Kondal

Hello, I’m Kondala Rao, known as Kondal. With extensive IT experience spanning product development, solution consulting, and business conduct, my passion lies in hands-on experimentation with the latest features of the Pega Platform and other low-code/no-code platforms to benefit businesses. Whenever I get free time, this blog is a space where I share insights, tips, and tutorials to help you leverage these technologies effectively.

I believe that even if one person benefits from my insights, it enriches my purpose to serve better. Join me on this journey of exploration and learning, and let’s elevate our skills together.

Happy Reading!!!

Let’s connect