facetwp get value of facet filter

(function($) {
    $(document).on('facetwp-loaded', function() {
        if ('undefined' !== typeof FWP.facets['facet_name'] ) {
            if ( $.inArray( 'some_value', FWP.facets['facet_name'] ) > -1 ) {
                // update form value as needed in gravity form
            }
        }
    });
})(jQuery);