cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Web Service Action in For each loop

Hello everyone,

as you can see in the screenshot.

I split a multiuser field from a SharePoint List and save it into a collection variable.

The for each loop works for each value in the collection but just for the action "Send notification" the web service action is just executed once.

What could be the problem ?

Thanks in advance.

BG,

Atilla

Labels: (2)
0 Kudos
Reply
5 Replies
Workflow Hero

Re: Web Service Action in For each loop

Hello,

Use the count option on the collection operation action to see what the size of the collection is.  It may be that the split isn't working as planned and its considering your collection size to be only 1.

Thanks

Mike

Accept as Solution Reply
Workflow Hero

Re: Web Service Action in For each loop

I guess you are calling UserGroup.asmx web service and its method AddUserToGroup...

I'm not sure why it wouldn't work in loop, but the loop is not needed at all.

there is as well method AddUserCollectionToGroup which allows you to add all the users in once

UserGroup.AddUserCollectionToGroup Method (WebSvcUserGroup) | Microsoft Docs 

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Web Service Action in For each loop

Hi Marian,

that is right i am using usergroup.asmx.

But for AddUserCollection to group, i guess there is a variable needed which contains xml.

But how do i convert a multiuser field into a xml variable ?

BG,

Atilla

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Web Service Action in For each loop

Hi Mike,

thank you for your reply.

I tested it and the size of the collection is 2. So the loop should repeat 2 times but it doesnt.

BR,

Atilla

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Web Service Action in For each loop

have a look eg. on this - https://community.nintex.com/thread/18099-query-and-filter-list-if-criteria-is-included-in-colletion... 

it's not direct example for usergroup webservice, but logic to convert people field into a XML would be the same

0 Kudos
Accept as Solution Reply