I created a basic workflow to extract the data in a repeating section. However, every time I run it, the loop gets skipped over. Here's what it looks like:
I've confirmed that the variables within the loop have proper values. In this case numItems = 3 and numIndex = 1.
No errors come up during the process. At the end, it looks like the workflow has completed. However, it has skipped over the loop entirely. Has anyone else encountered this? Please let me know. Thanks!
Loop: This workflow action runs a set of child actions while a condition evaluates to true.
Based on your screenshots, the loop only runs when numIndex (1) equals numItems (3). Because they are not equal, the loop is not executed. I think you need to do something other than 'equals' (like 'less or equal').
but I wonder whether you need a loop at all.
query XML action allows to define as many xpath expressions as you need. so I don't need a reason for loop.
single query XML action with 3 xpath expressions is much more effective then loop with 3 iterations and query XML action with single xpath expression within it.
I just tried using "less than or equal to" and the workflow still skipped over the loop section. I tried just "less than", as well, but with the same results. I also filled out a fresh new form and then ran the updated workflow. Still, the loop was skipped. I am at a loss!
How would I be able to extract data from a repeating section without a loop? Each row has 5 fields and a user can add multiple rows. If you could show me how to do this type of extraction of data without a loop, I'd really appreciate it!
I finally got it working! As it turns out, the loop won't start unless a "return type" is chosen. And of course, the "is less than or equal to" selection allowed all 3 entries in the repeating section to be captured.
Thanks to the two people who replied!
it's quite simple
let's have repeater XML like this
<?xml version="1.0" encoding="utf-8"?>
then you can configure Query XML action like this
I defined 3 outputs for 3 RS fields (ID, name country)
output will then look like this
so you get 3 datasets (one per each column) with as many rows as you have in RS.
important is that since you get dataset you have to store result into collection variables and not scalar ones!
Glad to see that you got it working! Be sure to mark your question as answered so that others can find out what you did quickly!
If you have more questions regarding the repeating section and extracting your data, I would suggest starting a new question so that you can surface those answers there a bit easier!