TOPIC:

Get Value from Custom USER Fields 1 year 11 months ago #229479

  • Topic Author
  • gvalcho
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 25
  • Thanks: 0
You are right. It does work.

However, I do have a further question. The code pulls in the description, not the value. I have a dropdown custom field. An example is: "New York, NY" with value "newyork". When I use the code above, the form is populated with "New York, NY" not "newyork".

For my purpose, that is fine, but if I wanted the value field, what would change?

Thanks, George

Please Log in or Create an account to join the conversation.

Get Value from Custom USER Fields 1 year 11 months ago #229480

  • Topic Author
  • gvalcho
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 25
  • Thanks: 0
You are correct it does work.

Please Log in or Create an account to join the conversation.

Get Value from Custom USER Fields 1 year 11 months ago #229492

  • DarkoCujic's Avatar
  • DarkoCujic
  • Offline
  • Developer
  • Developer
  • Posts: 2154
  • Karma: 67
  • Thanks: 264
Hey,

easy. Instead of looking for value inside $customfields, you'd look for rawvalue. Like this:
ff_setValue('gender', $customFields[1]->rawvalue);

Kind regards,
Darko
Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!

Please Log in or Create an account to join the conversation.

Last edit: Post by DarkoCujic.

Get Value from Custom USER Fields 1 year 10 months ago #230321

  • dunbarr's Avatar
  • dunbarr
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 15
  • Thanks: 0
Darko:

I tried your solution, but I think I have the code wrong.

<?php $customFields = FieldsHelper::getFields('com_users.user', JFactory::getUser(), true); return $customFields->value; ?>

I'm trying to pull the value from custom field Organization in a one liner.

Please Log in or Create an account to join the conversation.

Get Value from Custom USER Fields 1 year 9 months ago #230352

  • DarkoCujic's Avatar
  • DarkoCujic
  • Offline
  • Developer
  • Developer
  • Posts: 2154
  • Karma: 67
  • Thanks: 264
Hey Dunbarr,

that's cause you're not specifying from what element of array to pull the value. $customFields is an array where each element is an array of parameters of each field.
So, you're going to have to output it first to see how your array is structured. Please follow the first part up to and including echo '<pre>'... from this post crosstec.org/en/forums/3-breezingforms-f....html?start=0#229036

When you preview the form, you'll see all the fields available. You have to find the one you need (organization) and then change, in your one-liner, the return so it returns the value from that specific element in the array. (something like return $customFields[2]->value;)

If you get stuck, let me know.

Regards,
Darko
Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!
The following user(s) said Thank You: dunbarr

Please Log in or Create an account to join the conversation.

Get Value from Custom USER Fields 7 months 2 weeks ago #238536

  • davidbr117
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
hi DarkoCujic

please could you help me out, ive created a custom field in the backend under user fields called points, i want to output the field in a custom module, ive used the code above but nothing is being displayed

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.084 seconds

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!