XML Data Source to pull records from another instance issues

mcconnellsj
Kilo Sage

Trying to desperately hard to create data source to pull data from another instance.

I followed the guide for Orlando here but it is doesn't really represent what I see.

First thing is that docs refers to a field called XPath root node but the form has "XPath for each row" - is this the same thing?

Assuming it is, the guide says to simply state the table name as the source_table_name.  For example lets say it is the contract table so try: ast_contract.  However this does not pull any rows.  The only value that works is //ast_contract but this gives a warning about using relative paths.  What is the absolute path it is expecting (and that works).

Finally, I don't want it pull all records, but unsure how to specify a query in the file path, for example:

/ast_contract.do?XML&account=55ac0ae8dbb7430....

This does not work.  Only /ast_contract.do?XML works for me.

Does anyone have any tips on:

- An XPath that works but is not relative

- Pulling part of the table using a query

Thanks - I am no XML guru ...

find_real_file.png

 

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,

 

Xpath for each row will be /xml/ast_contract

Set file path field to blank and it should go as part of connection URL. If this field is not visible then please make sure to configure the form layout and add it. Once you have then copy query through encoded query per your requirement i.e append after XML&sysparm_query=your encoded query 

https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/using-lists/task/t_GenEnco...

View solution in original post

2 REPLIES 2

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,

 

Xpath for each row will be /xml/ast_contract

Set file path field to blank and it should go as part of connection URL. If this field is not visible then please make sure to configure the form layout and add it. Once you have then copy query through encoded query per your requirement i.e append after XML&sysparm_query=your encoded query 

https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/using-lists/task/t_GenEnco...

Thanks!  This will help me move forward.

(Strange that docs gives the wrong example)