The main problem I’m running into with the new file upload properties is that it doesn’t seem like I can access the file url in custom modules using the crm_objects() function. Any new files uploaded to a file property just return an id number so I can’t display images, link to pdfs, etc.
Is there any way to use the id number returned for the new file properties so that images can be displayed, pdfs can be linked, etc?
The file properties also don’t seem to have any connection to the file manager. When you go to upload a file into the new file property, the only option is to upload a local file and there doesn’t seem to be any way to choose a file from HubSpot’s file manager instead.
Has anyone figured out a way around this?
Thanks!
@KSmithIllumine8 - this is a tricky one to respond to in this forum. On the one hand, I would not want to insert a viewpoint that should really be between you and the HubSpot support team. On the other hand, having just been through the experimentation path on file upload API and the “new” file properties, I have a little insight that could be helpful.
I do notice a difference between file properties uploaded via a form (at least those loaded historically) and those set via an API call or workflow step. I have “file” type properties set from form fills today that are in the form of a signed URL. I just re-tested that in fact.
I also have “file” type properties on an object set as a follow up to a file upload API call that can apparently only be fileID strings if they are displayed and referenced in the UI (looking at the all properties information for example.) I tried setting these new properties to a URL value and got a UI error.
The documentation (screenshot) says that file properties are stored as URLs, but that doesn’t seem to be fully consistent with the observations above.
I can’t tell where your uploads are coming from, so I’m not sure either of these cases is a match for your challenge.
In order to convert my FileID properties to a usable URL for later processing, I used the file API again to get all the file details:
https://api.hubapi.com/files/v3/files/{fileID}?properties=url
Although this API documentation is a little ambiguous right now in terms of needing an ID or “file path” as a parameter - agoin my current experience suggests is that it’s designed around an ID string.
Good luck and let us know the outcome!
Steve