3

I'm having an issue in retrieving the User information in a list field.

I'm calling an web service like: https://mysite/_api/web/lists/getbytitle('list')/Items?$filter=Product eq 'Bananas' and Level eq 'Two'

This filters my search to just one result, and when I try to log in WF history fields like title, product etc. , with d/results(0)/Title for example, everything works fine.

There is one field that is an user type field, and I need to retrieve that user filed info such as Id, Name, Email, etc.

Could you advise on the best way to do this?

2

You will need to $expand the user field in the query like this:

https://mysite/_api/web/lists/getbytitle('list')/Items?$filter=Product eq 'Bananas' and Level eq 'Two'&$expand=MyUserField&$select=MyUserField/ID,MyUserField/Name,MyUserField/EMail,Product,Level

If this is a multi person field you'll need to retrieve them like d/results(0)/MyUserField/results(0)/Name

Some more examples here: https://msdn.microsoft.com/en-us/magazine/dn198245.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.