Body: <p>I would like to ask how to use alterFields in existing (already in core) Activity afformEntity. I don't think I can override it so I used civi.afform_admin.metadata and was able to use alterFields. But these alterFields doesn't seem to be used when the public form is being viewed. Thank you</p>
  <p>Is there something I am missing.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-05T01:43:47.923Z
Comments.Text: i expect i am not understanding, but many FB are built from SearchKits - so i wonder if what you are trying to alter could be done in the SK
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-09-09T00:46:00.037Z
Comments.Text: @petednz-fuzion thanks for the feedback. Sorry for not having a more detailed information. 
  
  -For now I used afform metadata hook to alter the entity. I just had a field that was using OptionValue entity which was not populating the data on drop down. So had to use api4 entity of the preferred entity. 
  
  -But since the fk_entity is not carried over to rendered page, I also used alterAngular hook to correct the needed fk_entity.
  
  -P.S. Is it possible to add js scripts in alterAngular hook for afform public page? The purpose is to handle onChange.
Comments.UserDisplayName: darkmode
Tags: <formbuilder>
Title: FormBuilder: alterFields afform entity
ThreadText: # FormBuilder: alterFields afform entity
  
  (Asked by: username_0 on 2024-09-05)
  
  I would like to ask how to use alterFields in existing (already in core) Activity afformEntity. I don't think I can override it so I used civi.afform\_admin.metadata and was able to use alterFields. But these alterFields doesn't seem to be used when the public form is being viewed. Thank you
  
  Is there something I am missing.
  
  **Tags:** formbuilder
  
  > **Comments:**
  > **username_1**: i expect i am not understanding, but many FB are built from SearchKits - so i wonder if what you are trying to alter could be done in the SK  
  > **username_0**: @petednz-fuzion thanks for the feedback. Sorry for not having a more detailed information.   -For now I used afform metadata hook to alter the entity. I just had a field that was using OptionValue entity which was not populating the data on drop down. So had to use api4 entity of the preferred entity.   -But since the fk_entity is not carried over to rendered page, I also used alterAngular hook to correct the needed fk_entity.  -P.S. Is it possible to add js scripts in alterAngular hook for afform public page? The purpose is to handle onChange.  
  
  ---
  
  ## 0 answers
  
  