New Query field can't be mapped to Moodle

2 years 2 months ago #313512 by traceyfield
New Query field can't be mapped to Moodle was created by traceyfield
Hi, sorry, I don't mean to take over the forums with my questions! Today I have purchased CB Query Field and successfully negotiated SQL to populate a new profile field. All good there.

However, my next step was to map the new profile field over to Moodle (I use Joomdle for this) only to find that I can only map basic fields, not advanced fields which I'm now guessing a query field is.

My plan was to be able to use the data in the new query field to be able to sort users into cohorts and groups in Moodle.

Is there anything I can change in the new query field so that it can be mapped in Joomdle/Moodle? Or can the data be replicated in any way into a basic field?
Or any other obvious suggestions that I can't see because I am so focused on what I was trying to do.

All suggestions welcome. Thanks

Please Log in to join the conversation.

2 years 2 months ago #313513 by krileon
Replied by krileon on topic New Query field can't be mapped to Moodle
We're not the developers of Joomdle so I've no clue why it can't map the query field. My guess is because the query field is just querying data from elsewhere and is not actually stored to their profile (the _comprofiler table), but that shouldn't be a problem if Joomdle uses getFields API. You'd need to talk to the developers of Joomdle regarding this as I'm guessing they're just pulling data from the database directly to push to Moodle. They can use the below API, which will work for grabbing the data of any field type (including Query fields) instead of accessing raw database data.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18361-obtaining-field-values-through-getfields-api

For their usage they'll want to be sure $output is set to "php" so they get raw PHP values to pass along. This will respond with an array value that they'll need to handle.

The only alternative is to use something like CB Auto Actions to push your query fields value to a text field on login or profile update so it's stored in the database then map the text field in Joomdle.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: traceyfield

Please Log in to join the conversation.

2 years 2 months ago #313514 by traceyfield
Replied by traceyfield on topic New Query field can't be mapped to Moodle
Thank you that really helps me to understand how it all fits together. I will read the link and get in touch with the Joomdle developer about getFields API as that sounds like the key! I'm determined to get it all linking up!
Thanks again for your help, Tracey
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.168 seconds

Facebook Twitter LinkedIn