How to fill a field in all symbols in a schematic with a "formula" (ie. a default value)

“Hobbyist” question: I have a field “Designation” with a calculated value like ${WIO_Prefix}${VALUE}${Case} which represents my part number and should be in the BOM.
So a resistor with prefix R, value 10K and case 0805 yields R10K0805.
With field name templates I make sure every symbol has those fields, if empty.
When it comes to the “Designation” field, I’m stuck. How can I feed the formula into the “Designation” field in all symbols? If the field name tempate had a value field (as kinda default value), that would be a breeze, but nope. No value for field name templates.

Any ideas or something I missed?

The "Field Name Templates** are ecactly that. It’s a template for adding fields to symbols which do not have those fields yet.

If you want those fields to filled in in advance , the most logical option is to add those fields + their values to the symbols in your library.

It also reminds me of this recent thread:

Another possibility is to not do it at all. It looks to be redundant information, and you can probably create it by some customized BOM script.

It also reeks a bit like the wish of a database library.

That’s what I do now

It might look redundant in the case of R. But I have various prefixes for various capacitors like CTS (capacitor tantalum SMD), CK (capacitor ceramic), you get the idea. I want their reference to be C inall cases, so no redundancy here. Same goes for trimmers (RV resistor variable), RP (resistor pot) etc.

As a hobbyist responsible for only me and me alone I can do that without having to think about what’s a norm, what engineers expect atl.

But I’ll stick to my proven BOM script. Was just exploring what possibilities the new BOM opens up.

I was thinking more about my last remark while you were typing, and I do think that if you want this sort of customization, then the database libraries are probably the way to go. Databases exist for handling and creating this sort of information.

But if you only have a limited range of capacitor types, then you could create a simple library which has a pre defined string for each of your capacitor types.

Yeah, sure.
But then: my BOM works, at least until the python API changes. I only thought calculated fields could make a user-specfic BOM obsolete.
I’ve built my libraries over the years and I’m not in the mood to set up a new database. Not my definition of fun.
But thanks for your comments anyways and let’s leave it there (topic automatically closes in 1 hour).

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.

I finally accomplished what I intended to do. Here is the field definition:

and here’s the outcome:

kicad_WMVorkYsqs

NOW it’s closed :slight_smile: