FOLLOW-UP: I did some more digging and found this article that helped answer some of my original questions:
www.rsjoomla.com/support/documentation/rsform-pro/custom-scripting/autopopulate-a-field-from-community-builder.html
.
They provided the sample code below, so it does sound like I can pull data from CB. So my revised questions:
1. Will this code work in J4?
2. What do I change to prepopulate other field items like address?
//<code>
$user = JFactory::getUser();
$db = JFactory::getDbo();
$userId = $user->get('id');
// Is the user logged in?
if ($userId) {
// Grab the value from the database.
$db->setQuery("SELECT `firstname` FROM `#__comprofiler` WHERE `user_id`='".$userId."'");
return $db->loadResult();
}
//</code>
My guess is to just change 'firstname' to the field name in the database
$db->setQuery("SELECT `customfieldname` FROM `#__comprofiler` WHERE `user_id`='".$userId."'");
return $db->loadResult();
3. If I wanted to display the full name (first + last) since I have each name as a separate field item, how can I return both together? Would I program 2 queries and then loadResult both? Sorry, I know this is all about SQL and not about CB.