Skip to main content
Nintex Community Menu Bar
Solved

Web Request: GetUserCollectionFromGroup

  • April 5, 2017
  • 11 replies
  • 233 views
  • Translate

Forum|alt.badge.img+4

Hello everybody,

 

I'm struggeling to get the Web Request action to work with the GetUserCollectionFromGroup request  (https://mytenant.sharepoint.com/_vti_bin/usergroup.asmx ) and hope someone of you can give me some advice on this.

 

I used the RemoveUserCollectionFromGroup request before and it was working fine, but I'm not able to get all users with the other request. Basically I implemented all my steps similar to this example How to Get All the Users From a Specific SharePoint Group Using NINTEX Workflow 

 

Here is what I did in Nintex for Office 365:

201483_pastedImage_444.png

201485_pastedImage_446.png

 

 

201475_pastedImage_439.png

 

201482_pastedImage_443.png

201481_pastedImage_442.png

201480_pastedImage_441.png

201486_pastedImage_447.png

 

Here are the results:

 

201488_pastedImage_668.png

201489_pastedImage_669.png

 

The group "Managers" has currently 3 members but when I log the collection it looks pretty empty. Regarding to the status code the request was successful.

 

I might have done something wrong in the Query XML step. Is there any way to see the full XML response that is cut off in the log?

 

Thanks,

Jan

Best answer by TomaszPoszytek

I agree with Ben - try to send the response body to your email to be sure it does contain what you expect.

Second thing - what "Content Type" in request header are you using? It should be: application/soap+xml; charset=utf-8.

And the last thing - try changing Method from "SOAP 1.2" to "POST".

I would also recommend you to use the following xPath Query when working with the XML:

//*/@LoginName

Yours doesn't seem to work for the response body XML as the Name Space differs.

Regards,

Tomasz

View original
Did this topic help you find an answer to your question?

11 replies

Chris_Ben
Nintex Employee
Forum|alt.badge.img+14
  • Nintex Employee
  • 360 replies
  • April 5, 2017

Hi Jan,

Can you email the XML to yourself instead of using the logging action (which has a character limit)?  Or if the email fails, write the XML to a multi-line field on a list somewhere.

Cheers,

Chris

Translate

TomaszPoszytek
Forum|alt.badge.img+17

I agree with Ben - try to send the response body to your email to be sure it does contain what you expect.

Second thing - what "Content Type" in request header are you using? It should be: application/soap+xml; charset=utf-8.

And the last thing - try changing Method from "SOAP 1.2" to "POST".

I would also recommend you to use the following xPath Query when working with the XML:

//*/@LoginName

Yours doesn't seem to work for the response body XML as the Name Space differs.

Regards,

Tomasz

Translate

TomaszPoszytek
Forum|alt.badge.img+17

I do receive the following XML when testing using postman‌ app:

Verify if you are getting the similar response body for your group.

Regards,

Tomasz

Translate

TomaszPoszytek
Forum|alt.badge.img+17

You could as well use this query (to exclude all records from your group that are not a regular users, but for ex. a claim or an ad group):

//*[contains(@LoginName,'@')]/@LoginName

but from what I recall when testing xpath in Nintex "Query XML" none from the functions worked, as the xpath syntax is not fully supported. But you can give it a try

Regards,

Tomasz

Translate

Forum|alt.badge.img+4
  • Author
  • 10 replies
  • April 5, 2017

Thanks for your reply Chris. I tried this already before but the email and also the multi line field remained empty. I will try it again it must be some issue with the data type...

Translate

Forum|alt.badge.img+4
  • Author
  • 10 replies
  • April 5, 2017

Hi Tomasz thanks for your reply. This more generic XPath (//*/@LoginName) is doing the job and it's either working with POST or SOAP 1.2.

The only thing that is weird is that I can't send the XML via email or write it in a multi line text field...

Cheers

Jan

Translate

Forum|alt.badge.img+4
  • 12 replies
  • May 22, 2020

Hi Janasmuth, 

could you post how this was resolved? I am having the same requirement.

Translate

Hi

I have following the same steps and unable to get response.

I am getting the response as attached and Query XML was failing.

 

 

I have tried with the Xpath as well

/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@Name
/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@Email
//defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@Name
/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@Email
/defaultNS:GetUserCollectionFromGroupResult

Translate

Forum|alt.badge.img+4
  • 12 replies
  • May 22, 2020

@Admin_Maraicar 

please try to use

 //*/@LoginName

This worked for me. The xml collection then needs to be iterated in a foreach. 

Let me know if that works.

Translate

HI @vaibhavk 

Did you get XML response as above.
Did you use SOAP 1.2 or SOAP 1.1 or POST

Translate

Thanks a lot.

It started working fine now.

Sometime, suddenly getting 403 Forbidden for the same account. Do you have any ideas about it or faced it.
Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings