afterInsert hook to save url of form submitted PDF file into collection

Hi Wix experts :slight_smile:

I have a user form that submits various details but also a mandatory document upload as this form is to allow people to share created PDF marketing materials.

The upload document field is named #uploadDocument and the form name is #uploadDocumentForm

I then want a table to show the URL LINK to the various uploaded PDF’s.

Presently I have this working but it only shows a broken image link as the click on link to the file PDF as have set the uploaded file to URL instead of document in the collection.

How do I code an afterInsert hook that finds the Wix URL of the uploaded PDF document and adds this to the below Rich Text code to be stored in a new collection field named “RTPdfLink” such that I can have “Click HERE” as the link the user clicks on in the table?

Rich Text code to insert the PDF URL into (where XXX is the PDF URL in the form just submitted):

<p><b><a href="XXX"style="color:#0063be"><font color="#0063be">Clcik HERE</font></a></b></p>

Hi Wix experts.

I never received any feedback on this.

Can anyone help?