0

I want to create a flow to move items from one list to another list based on dropdown selected value, i have created a flow it is working fine but the challenge is, the new item form includes person or group filed with allow multiple selections as 'Yes'. if this field has more than one value the flow is creating multiple entries. My requirement is to create only one item including all the values in person or group how it happens in the source form. Any help would be really appreciated. should also required a help for email flow in a same way to trigger only one email for one entry.

7
  • In your description, it's not clear what triggers your flow to move item from one list to another list. Need to know specifically what changes in your item will make flow to move the items. Providing an example will help. Oct 4, 2020 at 17:29
  • Hi Rahman - Thank you for your support!! I want to trigger a flow based on dropdown selected value - Field name: Opportunity status & value: 'Closed'. It will trigger a flow few of the other fields are multi person group field - my flow is working fine but if the multi person field have more than one person then the flow is creating multiple items. My requirement is to have only one item in the destination list similar to source list. Similarly email flow, only email should be triggered when an item is created or modified - when there is two or more persons selected it sends multiple emails. Oct 4, 2020 at 18:56
  • So, when the Opportunity status=Closed, you want to move this item to another list, right? Maybe flow is triggering multiple times as data being updated multiple times, I guess. Within your flow, you can add a condition to check the status and then move the item. I'm not sure I understood how it relates to your [multi-person] field. Oct 4, 2020 at 19:00
  • As per my understanding, you are moving data from x list to y list. In x list you have multi person group field then do you also have same multi person group field in y list? Content type of both the list are same? Oct 5, 2020 at 3:39
  • Thanks Utkarsh - Yes content type on x list and y list are same, i used the x template list for y. Due to multi person field if user selects multiple persons (A and B) then the move items flow is creating two entries in y list with 1 entry with person field as A and another entry with person field as B rest all fields data remains as is. this is also happening similar way for email flow. Any help would be really appreciated. Oct 5, 2020 at 6:54

1 Answer 1

0

Here is the solution of your problem.

Steps of your flow should be like this,

  1. Put your trigger as-is Create and modified && Opportunity status=Closed,
  2. Initialize variable, PersonId type must be array
  3. Apply to each on variable Assignee(Multi person field)
  4. Send an HTTP request to SharePoint -> Get method -> https://coffee.sharepoint.com/sites/lorem/_api/Web/SiteUsers/getByEmail('Email') -> email address from Assignee(Multi person field)
  5. Append to array variable -> PersonId -> body('Send_an_HTTP_request_to_SharePoint')['d']['id'] -> Send_an_HTTP_request_to_SharePoint name must match the name of 4th step because it is formula
  6. Compose -> PersonId
  7. Send an HTTP request to SharePoint -> Post method -> https://coffee.sharepoint.com/sites/lorem/_api/web/lists/getbytitle('ipsum')/items ->

Headers,

{
   "Accept": "application/json;odata=verbose",
   "Content-Type": "application/json;odata=verbose"
}

Body,

{
   "__metadata": {
      "type": "SP.Data.YourListNameListItem"
   },
   "Title": "Lorem", //you can use dynamics variables here
   "Opportunity": "Closed",
   "AssigneeId": {'results':@{outputs('Compose')}} //multi person field == Assignee
}

Reference, How to patch a multi-person field from one SharePoint list to another

1
  • Thank you so much Utkarsh. let me try and update you on this. Have a good day!! Oct 8, 2020 at 6:54

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.