In the “Need help finding user info” discussion within the Dev category, Ryan_H seeks guidance on accessing custom user field data from the database to display dynamic content on user profiles. Initially, Ryan_H is struggling to query a specific custom field for their first Ruby plugin project. sam questions the necessity of a plugin for this task, suggesting built-in features might suffice. Ryan_H clarifies that the goal is to perform a GET request using a number entered by the user into a custom field, displaying the resulting metadata rather than the raw input number. sam advises against making third-party GET requests on-the-fly for every page view due to security and performance concerns. Instead, sam recommends pre-fetching and storing the resolved values directly in the custom fields, or if the identifier must be stored separately, performing lookups only on a regular basis rather than per request.
Can someone point me to the file or helper file that pulls user info? I don’t mind hacking my way through my first Ruby project but just finding the right file is proving to take ages for me.
I have a plugin that takes a custom user field and then displays that value on the user card/profile…well I want it to but I can’t figure out how to query that field. I have the dummy text displaying just fine but I’m going crazy trying to figure out how to get the value of that custom user field from the DB. Sorry for the noob question, this probably should not be someones first Ruby project but as a whole, I’m grateful for the thoroughness of this project and support.
I should have been more specific. I need to be able to have the user put in a number into that custom field. Then a GET request is made and the users profile is populated with some meta info that that number represents. So if I setup custom user fields that are blank, I just needed to figure out how to show only the specific custom fields I chose. In other words, don’t show the number the user populated, show the result of the GET request.
This is complicated, you don’t want to be doing GET reqs to a third party when random people browse your site unless this is heavily gated.
The simplest solution here is to do the lookups up front and store the resolved value in the custom field and not a custom identifier to the 3rd party. If you must store the identifier in another field and do lookups on a regular basis.