OnePassword.NET icon indicating copy to clipboard operation
OnePassword.NET copied to clipboard

Example on how to add Fields to an existing item?

Open almostjulian opened this issue 1 year ago • 1 comments

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?

almostjulian avatar Aug 29 '24 20:08 almostjulian

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

knippers avatar Dec 03 '24 15:12 knippers