Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

XML Data Structure Hierarchy

Avatar

Avatar
Validate 1
Level 1
ANCA04
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ANCA04
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ANCA04
Level 1

04-01-2019

All,

Full disclosure here, this is my first ever post to an Adobe message board, and I have been working with Adobe LiveCycle ES4 for about 2 solid months.  I have a separate program that will send a report file (in this case an Excel file) to a shared network folder, and I would like to leverage that data into my Dynamic form.  I have been using a XML tools add in, and developer tools in Excel to export an XML file I can use in LiveCycle.

Example Schema:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>

-<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

     -<Row>

          <Thing1>ABCD</Thing1>

          <Thing2>1234</Thing2>

     </Row>

     -<Row>

          <Thing1>DEFG</Thing1>

          <Thing2>1357</Thing2>

     </Row>

     -<Row>

          <Thing1>HIJK</Thing1>

          <Thing2>2468</Thing2>

     </Row>

Again my JavaScript brain is still in it's infancy,  but in my form I theoretically want to import data and output a respective <Thing1> to at least one object text field, one called say <Thing1Field>.   Maybe dynamic binding isn't at all what i need to do in this instance, please read on.

What I am hoping, or attempting, to do is have an end user type a number into a number field called "Thing2Field". They click a button to get the corresponding <Thing1> in the same row as a matching <Thing2> outputed to a text field called "Thing1Field".  Make sense?  My fruitless attempts:

Root.#subform[0]::initialize - (JavaScript, client)

xfa.host.messageBox("Please select data to import to form.","Attention", 3,1);

xfa.host.importData();

Root.#subform[0].Button1::click - (JavaScript, client)

<all of the stuff>

I continue to bang by virtual Javascript head against the wall in trying to figure out what <all of the stuff> could be and where to start.  I am fairly certain if I can figure out how to get the imported data into a declared variable I can work that into a 'for' loop with some conditional statements in order to set the raw value of that text field.  My vocabulary isn't the greatest yet and a lot of the methods people come up with are amazing.  I am really looking for an example.

Some may ask why I am using the .importData(); method.  Long term in building this form I would like to create a representative node in which this imported data goes into.  I have read that importing data from XML goes directly into the root.data?? node.  If you were to import a second file it would overwrite the original becuase how the method and the DOM is setup. The data file I am working with in this example updates not so frequently and is in a different 'system' than another data file I would like to import.  This other file would update frequently and has a lot more data present, it wouldn't be bound to the form but I need to call on the data to populate certain fields from it. 

I am aware LiveCycle allows multiple instances of database connections through SQL and such, which we are moving toward, however I need to get a current working model to allow us to prove viability.  Any help you could provide would be of great assistance.  Thanks in advance for your time.

Alex

View Entire Topic

Avatar

Avatar
Validate 1
Level 1
ANCA04
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ANCA04
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ANCA04
Level 1

27-05-2019

At the end of the day in order to get the drop down list to dynamically populate, the XML structure I was utilizing from the XML tools plug-in, in Microsoft Excel was creating the XML format I listed above.  You could probably write an example to get rid of the individual <row> listed above by putting all of the <Thing1>'s together and <Thing2>'s together is what worked.  Or if I wanted to maintain the relationship have <Thing1>CatInTheHat</Thing1> <Value1>Dr.Suess<Value1/>. I had to re-adjust my thinking on nodes and values in order to get this to work. 

Radzmar was spot on as usual, using the importData() method is a little clunky and his solution to import the data as a string is a good viable alternative the way I was presenting the problem.  Navigating the rules associated with the XML nodes is something I need to learn a lot more about.