Hi, Im trying to write a simple flow service that queries the db, maps to sql result to a user defined document [using mapping] and appending the resultant transformed document to a document list.

everything works fine till here. when i try to use pub:document:documentListToDocument, im asked for name and value. i dont know what to input.

i have searched this forum b4 this post and there was a specific reply saying to use pub:xml:documentToXmlString. this would convert docList to xml. i tried that and it doesnt work as told.

sorry if its a repost on same topic. a quicker response is really appreciated.

What you can do is create a document type that contains your resultant document list and append your sql results to this documentlist(new documentReference) and finally use pub.xml.document: DocumentToXMLString and map new documentReference to document input(set documentType=new documentName fully qualified name) this will give output xmldata(string)…

Is that the thing you are looking for?


I think you want to use the pub.list:appendToDocumentList built-in service. That will allow you to iterate over the results of your query using a LOOP statement, transform a single element from your query into a temporary document and then append that document as a new element of your target document list.

Be sure that your temporary document uses the same structure as your target document list and that you drop the temporary document after the appendToDocumentList call. Use a document reference to ensure that the structures match.

The appendToDocumentList service is discussed in detail in the Built-In Services Guide.