1

Question:

1) How to set up a REST/HTTP call in SharePoint Designer so you can loop through Multi-Value Person field and do something for each reference found?

2)Is it possible to use said reference (f.e. store it an SPD variable) and use that variable when creating a new list entry?

What I'm trying to do:

I'd like to make a REST-call and get all Groups mentioned in a Person/Group multi-value field of a single List entry. The Persons/Groups will then asumeably be stored in a dictionary. Then for each Person/Group in the dictionary, I'd like to create a new entry in a seperate list, and assign it to said Person/Group (so no more multi-value field).

What is/isnt working

I can set up a REST call that queues for a set of items and do an action for each item, so the SPD code and loop seem to work.

But, the moment I create the REST call that requests the field values of the multi-value Person field, the set of results seems empty (in the picture below, int_RESToutputcount is 0). But if I look at the XML returned manually, the information is definitially there, so my best guess is that the feed returned is slightly different for some reason and thus I need to change my SPD 'code' respectively.

Why I'm trying to do this:

First off, unfortunately I'm bounded to using SPD, Infopath and the web UI. No server access, no custom code.

What I have: - Custom list (Productieschema): Taskname, Start Date, Due Date

  • Task list (Task List): Lookup:list1(id), Person, Description, Completed

The idea is that 1 task has to be completed by multiple Groups (any of the participant can mark it complete). They have to be able to add commentary+an attachment. The groups shouldn't be able to see/edit each other's items (without going out of there way).

Each task would be assigned to 3-10 groups, meaning for each task, you'd have to enter 1 entry in list 1 and 3-10 entries in list 2. This means a lot of manual work as we have around 100 tasks. These tasks also come back roughly each year.

My solution would be to create a list 0. In this list we have all the fields of List 1 + a multi-value Person field. Then I'd like to create a workflow that 1) Creates an entry in list 1 2) Creates an entry for each Person/Group mentioned, and set its LookupId to the Id in list 1

Other alternatives

I have thought of using 'start a task process' and not bother with splitting up the tasks, but we want to have a 'monitor page' that allows us to see exactly which tasks are completed and which aren't. Also, each person has to be able to enter some reasoning, assign a status and add an attachment. Also, they should not see each others' tasks. AFAIK the 'start a task process' option doesn't allow for these requirements

Attachments

URL it works with (queues for all items, used to test my loop, it works but its useless of course) <site>/_vti_bin/client.svc/web/lists/getbyid(guid'894750BE-5D64-46DD-AC70-7AACB7906F0D')/Items

URL it doesn't work with and I don't understand why (queues for the 'assigned to' field of entry with )

<site>/_vti_bin/client.svc/web/lists/getbyid(guid'894750BE-5D64-46DD-AC70-7AACB7906F0D')/Items(<id>)?$select=AssignedTo/Name,AssignedTo/ID&$expand=AssignedTo/Name,AssignedTo/ID

The XML I get with the last webcall

<?xml version="1.0" encoding="utf-8"?><entry xml:base="https://sharepoint.utwente.nl/Team/FEZ/Planning_Control/_api/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:etag="&quot;6&quot;"><id>Web/Lists(guid'894750be-5d64-46dd-ac70-7aacb7906f0d')/Items(13)</id><category term="SP.Data.Task_x005f_OverviewListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" href="Web/Lists(guid'894750be-5d64-46dd-ac70-7aacb7906f0d')/Items(13)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AssignedTo" type="application/atom+xml;type=feed" title="AssignedTo" href="Web/Lists(guid'894750be-5d64-46dd-ac70-7aacb7906f0d')/Items(13)/AssignedTo"><m:inline><feed><id>96fc4741-c4e7-45ed-be11-e877a071451e</id><title /><updated>2017-02-24T15:57:02Z</updated><entry><id>efcec82b-c0a3-42dc-aff5-9e26ac6be8f6</id><category term="SP.Data.UserInfoItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><title /><updated>2017-02-24T15:57:02Z</updated><author><name /></author><content type="application/xml"><m:properties><d:Name>FEZ Planning &amp; Control monitor (CES)</d:Name><d:ID m:type="Edm.Int32">38</d:ID></m:properties></content></entry><entry><id>b2fa7303-3dbc-4d0a-8df2-fedd226a44a9</id><category term="SP.Data.UserInfoItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><title /><updated>2017-02-24T15:57:02Z</updated><author><name /></author><content type="application/xml"><m:properties><d:Name>FEZ Planning &amp; Control monitor (FA)</d:Name><d:ID m:type="Edm.Int32">41</d:ID></m:properties></content></entry></feed></m:inline></link><title /><updated>2017-02-24T15:57:02Z</updated><author><name /></author><content type="application/xml" /></entry>

(This specific entry has 2 Groups assigned which I want to use, namely:)

<d:Name>FEZ Planning &amp; Control monitor (CES)</d:Name><d:ID m:type="Edm.Int32">38</d:ID>

and

<d:Name>FEZ Planning &amp; Control monitor (FA)</d:Name><d:ID m:type="Edm.Int32">41</d:ID>

My SPD workflow looks as follows: (note: it should create 1 item in List Productieschema, and 1 item for each Person/Group resulted from the rest call)

Click here for SPD screencapture

Your Answer

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

Browse other questions tagged or ask your own question.