Adding a new document type field in form section

We need a new document type field in one of the form. So, we added a document upload box type field keeping the form section as parent. The script runs and adds a field in the form. On case form, the document field appears fine but after we upload any document and try saving the case, it throws an error saying “Invalid JSON record”. I’ve added this kind of field in v1.7 and it worked fine.but in v2, I’ve not found anything regarding this. So let us know if we can create a new document type field in a form and if yes, then how it should be.
Looking forward to hearing back on this
Thanks in advance

Hi, which country implementation are you doing this for?

We’re implementing it in Pakistan

Hi, apologies on the delayed response. After discussing with the technical team, I can provide you with an update. We do not have this exposed in the UI and we had changed the ability to add uploads specifically to a form since we have the “Other Documents” form where we are requesting users to upload documents. You can try adding a new field with a different to a new form and look at this: primero/other_documents.rb at master · primeroIMS/primero · GitHub

If you want to add additional document types then you will need to modify Rails MIME types here: primero/mime_types.rb at master · primeroIMS/primero · GitHub
And then will need to add/register this list in both places primero/attachment.rb at master · primeroIMS/primero · GitHub