Hi,
My smart value: smart value: {{webResponses.body.body.view.value.match("<tr><th[^\>]*><p><strong>Application Administrator</strong></p></th><td[^\>]*><p>(.+?)</p></td></tr>").match("<a .+?data-account-id=\"(.+?)\".+?>.+?</a>")}}
Returns a list of 3 user id's in logging formatted as: [xxx, yyy, zzz]
When I add Advanced branching, with this smart value I would expect that it fires 3 times but it does not. It fires once and shows [~accountid:5cf5014468fe490f20938072, 5af545395f0d5b06c28a8a76, 5f8d5e48606d40006928bcbd]
How can I loop through this list and perform actions with each of these items?
That match() function result is an array, rather than a list.
So the work-around when this happens is to strip off the square brackets with chained, remove() function calls, followed by a split() to create a list. Storing your original parsing into a created variable can help with this.
{{yourCreatedVariable.remove("[").remove("]").remove(" ").split(",")}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bill, thank you for the tip as you were partially on to something.
When I do
{{myVar.count}}
It showed only 1 item. However..
{{myVar.first.count}}
Did the trick and gave me 3 results. So I was getting a nested list back from the match function and had to use the first item to loop through.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To help diagnose things like this in the future, I recommend first writing the entire web response to the audit log. And then as you drill down you can write more expressions to the log to observe you are getting what is expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.