Gravity Forms – Monday creating single link from multiple files

Hi, I am adding a list of uploaded files via Gravity Forms to a Monday.com board using Zapier (“Create update in Monday.com”). However, when there’s multiple files, Monday.com is treating the whole list as a single link and auto-generating an incorrect URL.

Returned code example via gravity forms

[Files] => Array
        (
            [0] => https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file1.png
            [1] => https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file2.png
        )

However, when I insert the “Files” field into Monday.com it’s returned as a single link such as

<a href="https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file1.png,https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file2.png">https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file1.png,https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file2.png</a>

https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file1.png,https://www.domain.com/wp-content/uploads/gravity_forms/path/to/file2.png

How can this be returned a the correct 2 file references?

Thanks,

— Christiaan

Ended up fixing this by returning full HTML formatted links from a Gravity Forms Zapier hook – below for reference.

// returns files to Zapier as HTML rather than CSV / json to fix Monday.com integration
add_filter( 'gform_zapier_field_value', function ( $value, $form_id, $field_id, $entry ) {
    $field = GFAPI::get_field( $form_id, $field_id );

    if ( $field instanceof GF_Field_FileUpload && $field->multipleFiles && ! empty( $value ) ) {
        $files = json_decode( $value );
		$value = "";

		foreach ($files as $file) {

			$value .= '<a href="'.$file.'">'.$file.'</a><br><br>';
		}
    }

    return $value;
}, 10, 4 );

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.