Hi @ryankn,
Het is maar goed dat ik Nederlands ben, anders had ik je screenshot misschien niet gesnapt 😉
For everyone else reading along; I think this should be easier in the future, but for now you should be able to use this hook in your functions.php
.
add_filter('gfexcel_export_field_value_checkbox', function ($gform_value, $form_id, $input_id, $entry) {
$field = \GFAPI::get_field($form_id, $input_id);
return $field->get_value_export($entry, $input_id, true);
}, 10, 4);
Hope this helps you out. Succes ermee!
Thread Starter
ryankn
(@ryankn)
Hi Doeke,
Thanks for you quick response! Glad you understood the screenshot:)
When I use your code, there is no change unfortunately.
Should I put the form id (65) and the field ids (20, 21 and 22) somewhere in the code? If so, where exactly?
Thanks again!
Kind regards,
Ryan
Hi @ryankn ,
This will make it more strict.
add_filter('gfexcel_export_field_value_checkbox', function ($gform_value, $form_id, $input_id, $entry) {
// If this is not form 65 or not field 20, 21, or 22 keep the original value.
if ((int) $form_id !== 65 || !in_array((int) $input_id, [20, 21, 22], true)) {
return $gform_value;
}
// Otherwise, return the label instead of the value.
$field = \GFAPI::get_field($form_id, $input_id);
return $field->get_value_export($entry, $input_id, true);
}, 10, 4);
This filter does not have the extra params, but this code should meet your exact needs.
Thread Starter
ryankn
(@ryankn)
Thanks for the quick response! I used the code, but somehow it still shows the values instead of the labels in the Excel export.
Kind regards,
Ryan
@ryankn can you send me a .json export of your form to info@gfexcel.com? I’ll take a closer look
Thread Starter
ryankn
(@ryankn)
@doekenorg Just sent you an email 🙂
Resolved behind the scenes.