I have a document library, Resumes, that has a large number of resumes in it. There is a regular column on that library, called EmployeeID, that is already populated. I have an external content type ( ECT ) that is mapped to a table that lists EmployeeID and several other columns of information. I added this ECT to the library as an External Column.
I am looking for a good way to automatically go through all items in the document library, and copy the value from the "regular" EmployeeID column into the External EmployeeID column and have it update the other columns from the ECT. Any techniques are useful (PowerShell, Object Model, Workflow?) When we have tried this in the past with workflows the setting of the External Column did not report failure, but didn't actually trigger a lookup of the other data and the value didn't seem to actually get saved.
[Update] I have been working on this and am getting closer. I am using PowerShell to access the list and set the external column ID field to the value I want it to be.
The problem is that it doesn't seem to be triggering a lookup of the external data when that field is set.
my "list" (a document library) has a few normal fields and a set of external columns mapped to an ECT "EmplData".
When you use the GUI to add or edit the properties of an item, it works. When I use PowerShell to do the following:
$spList = $spWeb.Lists["Resumes"]
$spListItem = $spList.GetItemById(1)
$spListItem["EmplData_ID"] = "00300"
$spListItem.Update()
Sometime the external ID field gets updated when I the refresh the web page, other times it says "(blank)". In all cases it does not load in the other fields.
Is there some Update method that updates the rest of the elements? I gather from research that these are called "secondary fields", is the method to update the secondary fields based on the external item ID available in PowerShell cmdlets someplace?
[Update] I am finding that if I use:
$spListItem["EmplData"] = "000300"
instead of $spListItem["EmplData_ID"] = "00300"
it gets around the problem of the column showing "(blank)".
I still need to figure how to make it update the other external columns (also known as "secondary columns" I think)