1

I'm trying to access User Properties from within the workflow designer for Visual Studio.

I've gotten as far as getting the User's ID, and then looking them up.

My problem is that fields such as manager and department are not accessible within the properties for the GetDynamicValueProperties of that user.

My searches so far have only shown Sharepoint2010 which allows code-behind (I'm making this for O365), or sharepoint designer, which seems to have all of the properties available. I'm making an app for sharepoint in visual studio though, so I believe sharepoint designer is out of the question.

Is something along the lines of __metadata/department what I should be looking for?

0

You could leverage HttpSend activity by consuming SharePoint User Profile REST API to return specific user profile properties like Department.

enter image description here

Assume we need to retrieve current user Department property.

1) Add HttpSend activity and specify its properties:

  • Method: GET
  • Uri: string.Format("{0}/_api/SP.UserProfiles.PeopleManager/GetMyProperties",WebUrl)
  • ResponseContent: save result into MyPropertiesData variable. WebUrl variable stores current Web Url.

2) Then add GetDynamicValueProperties activity to extract Department property from result variable MyPropertiesData and specify its properties:

  • Source: MyPropertiesData
  • In Properties dialog enter d/Department path and assign it to Department variable

References

  • WebUrl is the string returned by the WebUri activity, no? – user64152 Aug 18 '14 at 11:32
  • Yes, that's right! – Vadim Gremyachev Aug 18 '14 at 11:34
  • Unfortunately, it's not working for me, but that is probably due to permissions or something; I'm marking your response as an answer due to it not working being most likely through my own inadequacy. – user64152 Aug 18 '14 at 11:46
  • I could verify it (permissions and etc.) and get back to you, but some later today. – Vadim Gremyachev Aug 18 '14 at 11:49
  • That would be amazing; sharepoint's workflows are making me tear my hair out. Thank you for all of your help. – user64152 Aug 18 '14 at 11:51

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.