(Beginner) Add a custom link field in items form

I would like to add a “Size” custom field to the item form,
I already have an Item attribute called Size that has options, e.g Small, Large, Medium

The custom field should be a link to the size item attribute. I.e the options should be the ones in the size item attribute.

I can add the field in the options input I have Item Attribute Value
but I have a problem with the filtering on the Size attribute.
Without a filter, the options appear as gibberish.
Screenshot 2025-03-19 at 12.08.19

No options are available when I add a filter as shown here: Creating Custom Link Field

Running ErpNext v15.52.0
Hosted on Frappe Cloud

How do I achieve this?

Good day @anthonyms

Welcome !

It sounds like you want to make use of the “variants” abillity of ERPNext.

Perhaps you should take a step backwards and just describe the actual goal
that you are trying to achieve.

E.g…
The goal is to have “Shirt” ( item ) but have multiple Sizes.
So, currently you are trying to solve this problem ( as stated in the line just above )
by adding a “Size” field to Item. So, if i have to guess , then you may want to
have a look at

https://docs.frappe.io/erpnext/user/manual/en/item-variants

If I am guessing incorrectly, perhaps you could just describe the actual goal.

Hi, I hope I am understanding your issue properly. First set naming rule for the doctype which is linked to Size field, if you are not setting anything in naming rule, default naming rule will be hashed value. Second, Open your custom doctype, in view setting of the custom doctype, set title field to your fieldname in linked doctype(lets say size is the fieldname, then set size) and check Show Title in Link Fields. After this try setting filter for the custom field in Item doctype.
image
I hope this is what you are looking for.

Thanks for your quick response.

I am aware of the variants’ functionality and I’m making use of it. I have some items that are variants, and they have a size and colour attribute. I’d like to add the size and colour attributes to items that do not have variants so that all items (whether variants or not) have these attributes.