Solved

Need help building my site workflow to update list item

  • 13 August 2021
  • 3 replies
  • 247 views

Badge +3

I have a SharePoint list built by someone else with a blank text field titles "manager" I am trying to build a site workflow to automatically go through each record look at the "name" field  ( people picker) then update the "manager" field with the manager name listed in the person User Profile. We DO NOT HAVE the query user profile action available.

 

I was able to build a list workflow to do this successfully by setting up the "update item" action to have manager equals user profile and the value is the name of the person listed in the "name" field.  I dont want to use a workaround by setting the list workflow to run on modified, then create a 2nd workflow to update all items when a record is modified which will change all records and then "kick off" the first workflow but it will be a never ending cycle and not the most efficient way to do this.

 

I am unsure how to build this as a site workflow so far what I did was

 

1) Query list action:

  • List name "old list"
  • Selected the field "ID" and stored in an collection variable and called it COLLID
  • Selected the field "Name" and stored in collection variable called COLLNAME

2)For each action:

  • COLLID stored into new action list ID variable called "VARID"

3)For each action:

  • "COLLNAME stored into new people/group variable called" VARNAME"

4) Update item action"

  • Update the list name "old list"
  • Where ID equals VARID
  • Field: Manager
  • Content type equals: User profile> Manager name (from the user profile)
  • Equals: Value: VAR NAME (I dont see "current item" in the drop down selection)  

 

I am brand new to site workflows so i likely built it wrong. an help would be greatly appreciate

icon

Best answer by kunalpatel 17 August 2021, 04:13

View original

3 replies

Badge +12

@milkdud1 your Steps in # 1 & 2 are fine....I will suggest you tweak a logic in step # 3.


 



  1. Use 1st for loop with ID Collection, also create number variable num_Index and use it in for loop action

  2. Now using collection operations action, COLLNAME and num_Index, select GET option and store it in a SLT variable

  3. Now follow your step # 4 logic

Badge +3

so just to make sure i understand below is my revised workflow


 


1) Query list action:



  • List name "old list"

  • Selected the field "ID" and stored in an collection variable and called it COLLID

  • Selected the field "Name" and stored in collection variable called COLLNAME


2)For each action:



  • COLLID stored into new action list ID variable called "VARID"


3)For each action:



  • "COLLNAME stored into  number variable num_Index


4) COLLECTION ACTION:


get action using COLL name and the num_index and store in new single text variable SLT Variable


4) Update item action"



  • Update the list name "old list"

  • Where ID equals VARID

  • Field: Manager

  • Content type equals: SLT variable


 


is this accurate


 

Badge +12

@milkdud1 you only need 1 for loop, the one where you use ID collection....inside 1st for loop action, add my logic i.e. collection operation 

Reply