Skip to main content
Nintex Community Menu Bar

Web Service Action in For each loop

  • May 16, 2018
  • 5 replies
  • 17 views

Forum|alt.badge.img+1

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

5 replies

Forum|alt.badge.img+12
  • May 17, 2018

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


Forum|alt.badge.img+14
  • Scholar
  • May 17, 2018

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 


Forum|alt.badge.img+1
  • Author
  • May 17, 2018

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


Forum|alt.badge.img+1
  • Author
  • May 17, 2018

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


Forum|alt.badge.img+14
  • Scholar
  • May 22, 2018

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

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