cancel
Showing results for 
Search instead for 
Did you mean: 
pam_lewis
Nintex Newbie

Decode XML in repeating section

Hi,  I have repeating section templates as ListA.  ListB is looking up (List Lookup) selection and copying in selected template.  Templates in ListA have the degree sysmbol coded as  °

(which as typing in template I used Alt 0176 and the degree symbol appears).  Whem the selected template is copied into ListB the xml code appears and does not convert it to the degree symbol ( ° ).

How do I reconvert it back to  ° ?  

done in onPrem 2013 Nintex Forms version 2.11.0.10 

 

Thank you for you help/answer.

 

Labels: (1)
0 Kudos
Reply
7 Replies
Automation Master
Automation Master

Re: Decode XML in repeating section

what's the use of copied template on listB?

will it be used again for a repeatingsection?

if so, you need not bother with conversion and it should display it correctly

0 Kudos
Reply
pam_lewis
Nintex Newbie

Re: Decode XML in repeating section

In List B it will be for information..  In List A the degree symbol appears after I enter it as  Alt key 0176, which appears correct for the degree symbol.  When copied to the repeating section in List B it is displayed as  °   as if it translated to its original code.

0 Kudos
Reply
Automation Master
Automation Master

Re: Decode XML in repeating section

how exactly do you copy it to listB?

 

 

0 Kudos
Reply
pam_lewis
Nintex Newbie

Re: Decode XML in repeating section

via a LIst Lookup field and javascript.--

function GetRSDataFromLookupSuccess(data) {
    //check the result set is not empty
    if (data.d.results.length > 0) {
        //get the xml data from the result
        var rsLookUPdata = data.d.results[0].rsdata2;
        //intiate xml parser
        parser = new DOMParser();
        // populate the parser with the xml data
        xmlDoc = parser.parseFromString(rsLookUPdata, 'text/xml');
        //get the item tag from the xml
        var items = xmlDoc.getElementsByTagName('Item');
        //foreach item in the xml
        for (var i = 0; i < items.length; i++) {
            //get the repeating section last row
            NWF$(rslastRowCSS).each(function () {
                var $row = NWF$(this);
                //set the field value
                $row.find('.rs2descriptionCSS input').val(xmlDoc.getElementsByTagName('rs2description')[i].childNodes[0].nodeValue);
 $row.find('.rs2typeCSS input').val(xmlDoc.getElementsByTagName('rs2type')[i].childNodes[0].nodeValue);
            });

              //Add new row dynamically
            rsdataObj.find('a').click();
        }

List A has 3 fields - Title / description / type

when filling in the field 'type' using the Alt key+0176  results =  ° F

after saving converts to this in the 'xml' - <rstype type="System.String">&amp;#176

 when copied in to List B appears as #176

0 Kudos
Reply
Automation Master
Automation Master

Re: Decode XML in repeating section

via a LIst Lookup field and javascript.--<

I guess this might be your problem.

XML encoded degree sign looks like  '&amp;#176'

lookup fields/controls use ';#' pair of characteres as separator between ID and text value.

if you hand over XML encoded data through lookup field/control it may misinterpret/damage your data.

 

0 Kudos
Reply
pam_lewis
Nintex Newbie

Re: Decode XML in repeating section

Is there a way to make it work so the degree symbol appears after the copy?

0 Kudos
Reply
Automation Master
Automation Master

Re: Decode XML in repeating section

I'm not sure ....

I do not know what you'd like to achieve, what's your setup, what exactly and how you are doing.... 

0 Kudos
Reply