We have this generic select field in our form (image attached)
How can we display this in a view?
It's not intended to be used as a persisting field (it does not save anything to the database).
Hence you can also not retrieve it from the Database to display it as it simply does not exist - it lives only in/on the Form.
You'd have to create a select field with Toolset Types for example, and then you can use the field in a View either for searching by it or displaying its values saved.
The generic fields can - if really required - be made persisting (so they save in the database), but that is a legacy feature, that we do not actively suggest anymore.
For this, you'd also have to renounce to the Drag and Drop Forms Builder and switch to expert mode.
Doing so will allow you to edit the core code of the generic field, and then you can add a persist:1, it makes sure that the field is saved to the database.
See https://toolset.com/forums/topic/cred_generic_field/#post-166826 as an example.
However, as mentioned this is a legacy feature that you'd be using at your own risk.
May I know what the reason for the generic field is? Maybe I can suggest a solution that does not involve generic fields.
Thank you for the options.
We have had a customization to auto populate buddypress profile fields to toolset forms.
For the visitor form, it auto populates which company the user is from, then a dropdown is shown with all the users from that company (Image attached visitor-form.jpg)
We have a view that shows all the visitors, (Image attached visitor-view.jpg) that each location can print out every day, we need to pull in the value of the dropdown field for 2 fields, "Person to Notify" and "Meeting with"
I understand.
The only way to display those fields is to save them and they do not save by default.
So either you'll need to add a persist:1 like I elaborated or, you need to create a custom Code hooked to cred_save_data() and update another Post meta field within it when the form submits, using the data from the Generic Field (can be accessed from the $_POST global)
The cred_save_data() is explained here https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data, and then WordPress API to update posts fields would be update_post_meta() https://codex.wordpress.org/Function_Reference/update_post_meta
Combined you can hook the update post function at the moment Forms saved the data - or you can add persist:1 to the generic field which will save it as a native WordPress meta field for the post.
In any case, the display would then happen thru the ShortCode wpv-post-field (if using generic field persisting) or the ShortCode for the Types Field you would be using if updating with Custom Code.
Please let me know if you need more details on this!
Thank you for the instructions Beda, we will probably need to get a contractor to this.