File Ingestion -> Parse XML -> String attribute -> TrueFalse Property -> Checkbox in Repeating Grid . what's the best way?
I encountered a weird error/situation when it came to displaying an image based on a checkbox value of true or false.
Using Pega 7.1.8.
We receive an XML file.
Within this XML file, there's a string attribute with a value of a 1 (to represent true) or 0 (to represent false). This attribute is not mandatory so it may not be set (thus meaning the property is null)
With the property initially mapped to a text property, attempts to presenting this within a Repeating Grid as a checkbox that if true, presents one image and if false present another image. This did not work and never presented the image properly. If the value for the objects were changed (either via activity that would load and change or through an SQL script) to a text value of "true" or "false", the checkbox property in the repeating grid would present the true/false images value properly.
When I attempted the parse XML mapping against a different property, this time a TrueFalse property, the same thing occurred; in that no true/false image was presented in the checkbox, yet the values of the loaded objects had the correct value of 1 or 0. Again, if I modify the values to be "true" or "false", the checkbox worked as expected.
I tried using the edit input section to convert the "1" or "0" to "true" or "false" but that never seem to take either.
summing it up.
input: XML String attribute with value "1" (true) or "0" (false)
output: In a repeating grid, with cell property of checkbox that allows the following: if true, true-image ; if false, false-image.
Given this, what are my options for solving this problem and what's the best one?
@Bhashkar, thank you for your reply and I suspect you would have let me down this path as well.
Just to follow and close this discussion as I found an answer that I had overlooked.
Adding this text in the event that others may find it.
To solve this problem, there's an activity that gets called right after the Parse XML call. Within the activity and before any processing of the clipboard representation of the XML occurs, a data transform can be called to convert the "1" (and "0") to "true" (and "false") to ensure the correct [expected] values are in place for the checkbox value in the cell of the repeating grid.