Search code examples
sharepointsharepoint-onlinesharepoint-list

Sharepoint list - autopopulate column with predefined looping list


I need to create a sharepoint list for task assignments. There is a predefined list of people to whom task should be assigned (Note: it does not need to be a sharepoint list, its just an example of displaying the needed data - employees names):

Employees

Ideally, the 'Assigned to:' column would automatically populate in the demonstrated manner:

List to be autopopulated

Meaning, whenever a user adds a new element, he puts another Task, the assignment is done automatically in the given order. I've tried every idea that I came up with and nothing worked. Any solution here highly appreciated.

I came up with temporary solution which assings random people [out of given 3] to newly created tasks. Solution + results below: Power Automate Solution Resulting list: Automated task list

Now, I need to replace the "rand" function in "Get item" [middle section] in Power Automate with anything that lists employees in given order, not randomly. Please advise

Working solution: enter image description here


Solution

  • Seems kinda basic algoryhtmic problem.

    What I suggest :

    • First load list of employees (Get Items activity)
    • Then use the ID column of the newly inserted item and apply the modulo of number of employees to get the index of the employee to assign the task to
    • then grab the nth employee login to assign the task