0

I have 2 lists:

  1. Student (lies in student domain)
  2. Employees (lies in employee domain)

They both have same columns.

I would like to create a new merged list which should also include a column called 'category' which would have 2 values 'Student' and 'Employee'. I will be using PowerShell. How should I achieve this?

This would categorize the merged dataset records.

Both lists are updated daily (realtime).

Also, is there a way where I can automate this merger? (so that I do not have to manually execute the script daily)

Thanks in advance.

1 Answer 1

0

Are you using SharePoint Online or SharePoint on-premises? The process would be quite different for these two products.

For SPO, it would be easier since the two domains would be on cloud, and you can use tools like Power Automate to update and sync automatically.

For SharePoint on-premises, you would need to establish connection between these two domains first. (A sample here: New-PSSession across domain boundaries.)

And to automate the process of merging the two lists, consider building an event receiver to do the daily task. See another similar post here: How to keep two SharePoint Lists in sync when located on 2 different servers.

2
  • It is SPO, I have edited the question now (removed tag). Do you have a solution where I could use power shell scripting? I have not used Power Automate before, I will look into it. Dec 18, 2020 at 21:20
  • @ParshvaShah The best thing I would know is to use PowerShell to copy list items across lists (a sample here: sharepointdiary.com/2017/01/…). You can delete the old records with PowerShell too, but it has to be a manual way. PowerShell script is not an ideal solution for this request. Dec 21, 2020 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.