Hi I have a need to be able to select an XML file, and use fields in it to populate an interface.
At the moment I have a simpe interface with a File Upload and a Rule Input of xmlData (Document) which the file upload saves to.
I am then kicking off a process model on submit which runs a script task.
I have activity class parameters for the fields I want and am running the following script on each one
Does anyone know what the error is more specifically? Am I on the right lines or is there a better way of doing this?
Discussion posts and replies are publicly visible
Hi David,
Few recommendations that I could give to you:
I’m adding a sample code below, in this example only the text of the tag "content" is retrieved:
xpathdocument( docId: 9999, expression: "/a:document/data/body/item/content/text()", /*sample namespace prefix just add if your input xml has ns*/ prefix: "a:http://www.appian.com/ae/types/2009" )
Regards,
Acacio Barrado.
Acacio Barrado said:The input for the expression should be the document ID and not the document itself
So just FYI... in almost all cases, there will be no difference, as the "document itself" (assuming you're referring to an object of type "Appian Document") is really just the document's ID, and use cases that require the ID will almost always typecast the document down to its integer ID if necessary.
Hi Mike,
I totally agree with you,
Thank you,
Acacio B.