Hi Rob, sorry for missing your question! I’ve asked Doeke to add his solution here.
Thanks, that would be great!
Hi @verysiberian,
Sorry for missing this question. I’m not sure why, but I’m not always getting notified by WordPress about these issues.
Could you tell me what type of field you’re using? Or even better; send me a json export of the form so I can import it locally. Would help me figure out the exact code you need.
You can send it to wordpress@doeken.org
Thanks!
Sorry for the delay. I have so many forms that it took me a bit to remember which one this was! I emailed it to you. I think the issue may be that the three user fields are Gravity Flow user fields, but if there’s a way to fix them in the export, that would be extremely cool.
Best regards,
Rob
Hi @verysiberian, thanks for providing the data. You are correct about the workflow_user
fields. These export the user id by default on a simple export.
A quick workaround for you would be to add the following snippet to your functions.php
.
add_action( 'gfexcel_field_value_workflow_user', function ( $value, array $entry, \Gravity_Flow_Field_User $field ) {
return $field->get_value_export( $entry, $field->id, true );
}, 10, 3 );
Or, in case you also want a reference to the user id to remain, you can go for this:
add_action( 'gfexcel_field_value_workflow_user', function ( $value, array $entry, \Gravity_Flow_Field_User $field ) {
return sprintf( '%s (%d)', $field->get_value_export( $entry, $field->id, true ), $value );
}, 10, 3 );
This last one will return the value like User name (72)
, where 72 is the user id.
Hope this helps you out.
Thank you very much! This is great and should do the trick.
Best regards,
Rob (Very Siberian)