This appears to be a Add Books question which is Library management question.
Moved there
I am not an expert in this area, so I will leave this to others for the code.
remember the custom fieldname stats with a # (

post the exact field lookup name if you want working code)
FYI anything not contained in a capture ( ) pair is dropped