Using Sharepoint Framework to inject code onto an edit field

Copper Contributor

Hi there,


I am trying to write some code in Sharepoint Framework to alter the behavior of a field in a document library in sharepoint. In particular I want this code to run when editing a single field of many. 


From various tutorials I have set up a form customizer environment. However, they all put it into a default "Hello world" state with some text, and then attempt to build a document library layout from scratch. How do I simply inject some code to alter the existing format of a document library instead of replacing it entirely?


Thank you!

4 Replies
What kind of behavior har you looking for ? it's easier to know how to do it then...
I'm looking to call our API for a list of addresses based on a postcode input into that field, Similar to how to does an AD lookup for users. It is only a single field we're looking to work on which is why i'm reluctant to build it all from scratch.
Injecting SPFX code won't really work for this...I would recommend you to replace the form with PowerApps forms instead, this is probably the easiest way also.



Unfortunately, you cannot inject code only for "single field" in list form using SPFx form customizer.


While using SPFx form customizer extension, you have to build everything custom on your own including UI of complete list forms, auto-populating field values for edit forms and saving the form field values back to SharePoint list.


If you want to customize only one field on list form, you can try customizing the list form using Power Apps. Check: Customize a Microsoft Lists or SharePoint form by using Power Apps 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.