Not exporting proper label

I have created two dropdowns…

Country (dropdown) - countries_list_c
uk_unitedkingdom - United Kingdom
nep_nepal - Nepal
ind_india - India
pak_pakistan - Pakistan

State (dynamic dropdown) - states_list_c
nep_kathmandu - Kathmandu
nep_pokhara - Pokhara
ind_delhi - Delhi
ind_rajasthan - Rajasthan
uk_london - London
pak_karachi - Karachi
pak_islamabad - Islamabad

It shows perfectly fine in the frontend, here’s the picture attached.

But the problem is when I export the leads, under STATE it shows the field name and not the label name.

It’s not exporting the label name.
I have created it twice but I don’t know where I am missing something. Please help!

Welcome co community! :tada:

It’s correct.
You can look at the function ‘export’ into the file - ‘include/export_utils.php’ (lines from 303 to 309).

This is what I have…

    case 'enum':
        if (isset($focus->field_name_map[$fields_array[$key]]['options']) &&
            isset($app_list_strings[$focus->field_name_map[$fields_array[$key]]['options']]) &&
        ) {
            $value = $app_list_strings[$focus->field_name_map[$fields_array[$key]]['options']][$value];

Is this correct?

1 Like

If the above code is correct still it’s not exporting label names.

What else do I need to check?

You should change the code as you want. Write the code which get the label for field type ‘enum’.
But you should remember that after update version your code will be remove.
The function return arrays include which into param ‘option’ of the field type ‘enum’: