A front end user, this would mean, thru a Toolset Form.
In Toolset Forms, you can add generic fields that are populated by a ShortCode.
So yes, you can create a ShortCode, which pulls the data from another Post Type or Post and then displays those values in the Generic Select Field of the Form.
The user can choose it, and with some Custom Code applied on cred_save_data() hook you can then persist that value to the database.
Note, that to have this working, you need to use Toolset Forms' Expert Edit Mode, because of this BUG:
https://toolset.com/errata/generic-fields-in-new-drag-and-drop-editor-will-not-persist-the-shortcode-passed-as-source/
How to create such a ShortCode is not subject of Support, however, it needs to match an exact syntax which is a JSON valid format, as explained in the Generic Fields GUI of Toolset forms (choose either Select, Checkboxes or Radio Generic Fields)
To persist the field in the database you can either add persist:1 to the Generic Field (but that is deprecated) or, use a cred_save_data() action to get the chosen Fields Values from the $_POST global and update some field in the Database with it.
cred_save_data() is explained here, and you can then use upate_post_meta() for example to persist the field:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://codex.wordpress.org/Function_Reference/update_post_meta
What you can also do, is generate the ShortCode with a View, this means, you create a View and in its loop, you generate the JSON valid output, then, you select to no wrap the View in any DIV, and use that View as ShortCode to populate the Generic Form Field.
Since Views is a pretty dynamic content render and query tool, you can basically output anything you want in its loop.
You will face 3 main challenges here:
- create the view or shortcode that produces valid JSON
- persist the field in the database
- work in Forms "Expert Mode" which allows no drag and drop
Please let me know if you need further help with this, I can assist such process and review custom code, but not craft it to 100% for you.
However our forum presents a large number of tickets where this topic was already elaborated as well, hence, these might be of great help to start:
hidden link..69i57j69i58.9725j0j4&sourceid=chrome&ie=UTF-8
- https://toolset.com/forums/topic/cred-generic-field-with-view-shortcode/
- https://toolset.com/forums/topic/populate-select-cred-generic-field-with-a-view/
- https://toolset.com/forums/topic/how-to-display-multiselect-generic-field-in-views/
Please ignore all the mentions of "views cannot produce a raw loop".
That is past, nowadays you can do this by simply checking the box to not wrap the view in any HTML, just below the View's Loop Editor.