2

I have managed to work a PS Script that added circa 9k items from a CSV file. After working some parsing issues with date/time, People fields etc. It's finally worked and all 9k items now sit on the SharePoint list, yaay.

I've just been approached, asking "can you fit in another column" with another 9k list-items, only this time it's just one column that needs adding/updating on the same list I just imported.

The concept that I can't understand is, I want to update the already created items, and not all of them either, just specific ones that fall within a range. What can I use as the anchor / unique identifier? I'm thinking item ID. What logic do I use to tell is to only update the ones that match the same ID number that's in the CSV file?

Thanks

1

If you saved the ItemId when you created the items it would be best to use that with SPList.GetItemById. If not you could use CAML or SPWeb.GetListItem. The latter is easier and I'd assume you would be able to easily determine the destination path based on your CSV.

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.