Go to previous topic
Go to next topic
Last Post 04/27/2020 11:15 AM by  David Williams
XML Node parse and assign
 10 Replies
Author Messages
Steph76
Solution Developer
Private
Basic Member
(42 points)
Basic Member
Posts:18


Send Message:

--
10/11/2019 8:54 AM

    Hello,

    I need to create a PF to update the date fields for a job. I have a Lawson Transaction Node to Inquire on the job and an XML Node to parse the output from it so I can get the current settings. I do not have an XSD. I noticed some of the fields have a dash in the name and I'm having a problem when trying to assign the value to a variable. Fields without a dash return a value. For example, XML9300_output.AR580[0].COMPANY, returns the Company. When trying to get the process level using XML9300_output.AR580[0].PROCESS-LEVEL, nothing is returned. I've tried the following different ways to get the value and I either get nothing or "error evaluating". Has anyone else run into this?

     

    XML9300_output.AR580[0].["PROCESS-LEVEL"] - error on node error evaluating

    XML9300_output.AR580[0]."PROCESS-LEVEL" - error on node error evaluating

     

    ** Lawson V10, IPD Product Version: 10.1.1.30.4710

    David Williams
    Private
    Private
    Veteran Member
    (3307 points)
    Veteran Member
    Posts:1113


    Send Message:

    --
    10/11/2019 9:00 AM
    Replace the dash - with an underscore _
    David Williams
    Steph76
    Solution Developer
    Private
    Basic Member
    (42 points)
    Basic Member
    Posts:18


    Send Message:

    --
    10/11/2019 10:14 AM

     

    Thanks. I was overcomplicating it. I didn't need the XML Node.

    t2
    Sr IS System Analyst
    Private
    Basic Member
    (12 points)
    Basic Member
    Posts:4


    Send Message:

    --
    04/27/2020 10:29 AM
    Hello, can you please share the exact assign node syntax that you are using? I've tried numerous syntax combinations and can't retrieve an individual node value - only the entire xml doc (XMLnnnn_output) assigned in the xml parse node.

    Thanks, Todd
    David Williams
    Private
    Private
    Veteran Member
    (3307 points)
    Veteran Member
    Posts:1113


    Send Message:

    --
    04/27/2020 10:46 AM

    Todd - are you referencing a Schema file? If so, then the XML should parse correctly and, depending upon the layers in the XML, can be referenced:
    ponumber = Parse_output.*:: DataArea.*:: SupplierInvoice.*:: SupplierInvoiceHeader.*:: PurchaseOrderReference.*:: DocumentID.*:: ID

    (Ignore the space after the double colon)

    David Williams
    t2
    Sr IS System Analyst
    Private
    Basic Member
    (12 points)
    Basic Member
    Posts:4


    Send Message:

    --
    04/27/2020 10:50 AM
    Hi David, I don't have a schema - just the XML output from the batch job inquire.
    David Williams
    Private
    Private
    Veteran Member
    (3307 points)
    Veteran Member
    Posts:1113


    Send Message:

    --
    04/27/2020 10:52 AM
    There are free resources online that will create a schema from the XML output for you.
    David Williams
    David Williams
    Private
    Private
    Veteran Member
    (3307 points)
    Veteran Member
    Posts:1113


    Send Message:

    --
    04/27/2020 10:55 AM
    You can try to reference the data elements as from my example without a schema - I'm not sure if it will work.
    David Williams
    t2
    Sr IS System Analyst
    Private
    Basic Member
    (12 points)
    Basic Member
    Posts:4


    Send Message:

    --
    04/27/2020 10:56 AM
    Hi David - wasn't aware that the schema was required - I've generated one and will try - Thanks!!
    t2
    Sr IS System Analyst
    Private
    Basic Member
    (12 points)
    Basic Member
    Posts:4


    Send Message:

    --
    04/27/2020 11:05 AM
    I've just never seen a sample flow that has the xml parse working - If you have a simple example, that would be much appreciated.

    Thanks, Todd
    David Williams
    Private
    Private
    Veteran Member
    (3307 points)
    Veteran Member
    Posts:1113


    Send Message:

    --
    04/27/2020 11:15 AM
    Infor provides free samples for the ION BODs processing. Look for a Sync_ prefix when downloading from within IPA. If you can't find, then email me and I'll shoot one to you. david@consultdavidw.com
    David Williams


    ---