[Forminator Pro] How to send file upload full URL to Zapier

I have been working on integrating a form with Zapier so that leads can go directly into an airtable sheet immeadeatley upon submisison. 

Everything is working great, except for getting uploaded photos into Airtable. Basically, to get this to work, I need Forminator to send the full url of each uploaded image to Zapier which then will get the images into Airtable. 

In theory, the ‘Upload 1 File URL’ should do this, but that seems to just return the root url of the site, not the actual file URL. 

Attached is an image of the options provided via the Zapier hook. I have tried using all of the ones that seem logical to me. What should I do to get this working? Thanks for the help! 

  • Pawel Pela
    • Ex Staff

    Hello Walton !

    Hope you’re having a good day!

    I’ve checked this setup on my test site and it turns out that in fact the image URL is sent as you’ve mentioned, ie. it’s not correct. This looks like a bug so I will create a report for the Forminator team, but I’ll also create a task for the Second Line Support team and will ask them to see if there’s any way we can provide you with a quick fix for this. The SLS team will reply here with feedback.

    Kind regards,
    Pawel

    • Walton
      • Flash Drive

      Hi pawelpela.

      Thanks for the prompt response, and I hope that you’re having a good day too!

      I’m glad to hear that it seems like there is a fix for this coming at some point. If SLS is able to share a quick fix, I can add any code snippets that they recommend. Otherwise, I will keep a lookout for a Forminator update that fixes this issue.

      Thanks again for the help, and I’ll look forward to whatever fix you all come up with!

  • Walton
    • Flash Drive

    Hi Tho Bui Thanks for the input. Unfortunately, I was already using the file URL. That said, in digging a bit deeper, I did discover some relevant information.

    When I am setting up the Zap and using the test trigger sent by Forminator, “Upload 1: File URL” is a test value that is allegedly sent. That said, when I look at the data actually being sent, there is no file URL being passed to the hook.

    For example, here is the test data sent over:

    name-1
    First Name
    name-2
    Last Name
    radio-1
    Is this for a business?
    text-1
    Name of Business
    email-1
    Email
    phone-1
    Phone
    radio-2
    Can you receive texts at this number?
    radio-3
    Will payment for this job be made by a third party?
    radio-4
    Would you like your estimate to include pickup and delivery?
    radio-5
    Do you think on-site work will be necessary for your job?
    address-1-street_address
    Street Address
    address-1-city
    City
    address-1-state
    State/Province
    address-1-zip
    Zip
    textarea-1
    textarea
    upload-1
    name
    Select Files
    type
    image/png
    size
    0
    file_url
    https://siteurl.com
    file_path
    /www/siteurl_536/public/wp-content/uploads
    form-title
    Estimate Request
    entry-time
    2021-09-23 14:01:16
    
    

    But then the actual data that gets sent to the hook looks like this:

    
    render_id
    0
    page_id
    336
    current_url
    https://ashevillefurniturerepair.com/new-form-test/
    _wp_http_referer
    /new-form-test/
    name-1
    Fake
    name-2
    Person
    radio-1
    yes
    text-1
    Humans Inc.
    email-1
    fakeperson@fakeemail.com
    phone-1
    1234567891
    radio-2
    yes
    radio-3
    no
    radio-4
    yes
    radio-5
    i-dont-know
    address-1-street_address
    123 Main St.
    address-1-city
    Asheville
    address-1-state
    NC
    address-1-zip
    28801
    textarea-1
    This is the test text.
    referer_url
    form_type
    default
    forminator-multifile-hidden
    {\"upload-1\":[{\"success\":true,\"message\":\"\",\"file_id\":\"upload-process-bty7zqp\",\"file_name\":\"cool_flower.jpeg\",\"mime_type\":\"image/jpeg\"}]}
    form-title
    Estimate Request
    entry-time
    2021-09-23 14:08:20
    querystring
    
    

    While I don’t understand the way the file upload field works, it would make sense that if no Upload-1: File URL is being submitted that no data would make it into Airtable which is the case.

    Any ideas? Thanks again for all of your help!

  • Walton
    • Flash Drive

    Hi Tho Bui !

    Unfortunately, even with using the Upload Field 1 URL as you are in your screenshot, I am still not seeing my photos in Airtable. Attached is a screenshot of the field settings that I am using. Could you confirm that these look ok to you and match your successful result?

    Also, perhaps this is relevant, this website is a multisite.

    Do you have any additional ideas? I would love to get this working and I appreciate your support in helping me do so!

  • Tho Bui
    • SLS

    Hey there Walton ,

    It seems you are trying to upload multiple files. Can you try this snippet code to support the multiple upload field?
    https://gist.github.com/wpmudev-sls/f63e4f371fcab0e37db5282d2944158b

    You can download a zip, unzip it and upload file forminator-addon-fix-upload-field-issue.php to your wp-content/mu-plugins folder. If that folder doesn’t exist you can simply create it.

    If you are not familiar with mu-plugins, you can read about them here:
    https://premium.wpmudev.org/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
    or you can paste it into your child theme’s functions.php file.

    Kind regards,
    Tho Bui

  • Walton
    • Flash Drive

    Hello again, Tho Bui

    I am happy to report that adding that snippet as an mu-plugin did the trick and I am finally seeing those images in Airtable!

    I am super appreciative for all of your help, and am happy to finally call this one resolved. Also, I’m impressed with your code :)

    Thanks again, and let me know if there is anything else you need from me, but this feels like a successfully resolved ticket to me!

  • Tho Bui
    • SLS

    Hey there Walton ,

    Something about this change has caused the HTML elements within my form to loose all formatting on save.
    Sorry to hear about this issue, the snippet code only handle for front-end so it’s weird to cause any issue on the back end. But I had a mistake on my snippet code when try to unset this variable:
    unset( $field_data['file']['success'] );
    https://gist.github.com/wpmudev-sls/f63e4f371fcab0e37db5282d2944158b

    I updated the snippet code, can you download it again?

    If your issue persists, can you enable debug mode to see any error/warning related to it? Or can you show me how I can replicate the issue?

    https://wordpress.org/support/article/debugging-in-wordpress/

    Kind Regards,
    Tho Bui

  • Walton
    • Flash Drive

    Hi Tho Bui ,

    Unfortunately, the problem remains. Attached is a video demonstrating it.

    EDIT: looks like I cannot attach a video, so here is a link to it instead:

    https://drive.google.com/file/d/12D7eRdt7D6KNYD_q__7h8FTtUgFWiiaY/view?usp=sharing

    I have created a copy of the site on a staging server, enabled debug mode, and would be happy to create a login for you and/or share sftp credentials with you. How could I securely share that information with you?

    Thanks again for the top tier support!

  • Tho Bui
    • SLS

    Hello Walton ,

    Thank you for your video. It seems some changes from the latest version caused this issue. I’ve already reported it to our developers, and they are looking into it to see why it’s happening and how to fix it.
    In the meantime, can you downgrade Forminator back to 1.15.2?
    You can use the attached file, or you can download it from our site:
    https://wpmudev.com/project/forminator-pro/
    You will see a list of all the old versions from the changelog:
    https://share.getcloudapp.com/OAun5Z6K

    Kind Regards,
    Tho Bui