OnePassword.NET
OnePassword.NET copied to clipboard
Example on how to add Fields to an existing item?
I've been trying to add a new field to an existing item without much success.
var items = onePasswordClient.GetItems(myVault)
var item = items.First(x => x.Title == "My Title")
//As is the existing fields collection is null, I need to do this to get fields
item = onePasswordClient.GetItem(item, myVault)
item.Fields.Add(new Field("My new field", FieldType.Concealed, "My New value"));
// This doesn't actually edit the item with the new field
onePasswordClient.EditItem(item, myVault);
Do I need to do something differently?
If your item is based on a custom template item, it might be the issue described in this PR: https://github.com/jscarle/OnePassword.NET/pull/81