cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

document

0 Likes
227

hi,

i am using a document action block inside a while loop and trying to update some rows of values in document..my question is whether the document entries will be still available in the furthur iteration of the while loop or it will be refreshed for each new iteration.....

thanks

karthick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

You should have the Document Action Block Outside of the while loop. each Iteration of the While loop will initialize the Document.

Answers (2)

Answers (2)

jcgood25
Active Contributor
0 Likes

Karthick,

You can easily use xpath in assignment links to update row values in an xml document. It will effectively work like absolute positioning, so assigning a link to your document object with ...Results{/Rowsets/Rowset/Row[1]/ColumnName} will update the ColumnName value for only the first row (Note: you will have to manually edit the Target XPath to add the [1] after you select the path to the ColumnName in the link editor window).

Reference the help docs for dynamic links as this will allow you to incorporate aspects to your xpath like [#Repeater_0.CurrentItem#] instead of a hard coded number like [1].

Regards,

Jeremy

Former Member
0 Likes

Karthik

Better use the <b>Repeater</b> Action Block instead of <b>While Loop</b> Action Block since Repeater action takes the XML Results and loop the results row by row if and only if XPath Target of Repeater is set to the row of XML results. Inside this Repeater, use <b>Row</b> action to append rows one by one to the XML Document.

Of course, <b>It is recommended that XML Document Action block should be always put outside and before Repeater Action</b>, otherwise, u can not update(append) the rows to the XML document while looping (Repeater).

But <b>While Loop</b> Action is used to perform a specified set of actions until a condition is met, or the max iterations count has been reached. All the actions that directly descend from the While Loop action will be executed for each iteration. You must set the Break property to true, or 1, to stop the loop.

Regards

Som