By Gene Teigland on Friday, 17 July 2015
Posted in Technical Issues
Likes 0
Views 769
Votes 0
First of all great job on your api for embedding ES fields into other pages. However I'm having an issue with extra characters showing up in the custom field type: Multi Dropdown List:

1. I have created this field in Profile types ES
http://www.awesomescreenshot.com/image/415864/822eef5a1f9c570ce3e036e1464d9e44

2. Im using your API (as given by your developer doc) to embed this into another page:
<?php $userId = JFactory::getApplication()->input->getInt('user_id');
$key = 'ARTMEDIUM';
$my = FD::user($userId);
$fieldData = $my->getFieldData($key);
echo $fieldData;
?>


3. However you will see in this screenshot that extra brackets and Quotes appear with this field type. This does not happen on other fields for example a text field. (Note: I'm good with the commas) but how do I remove the brackets and quotes.
http://www.awesomescreenshot.com/image/415870/7c200d024d9b02081b90b616fff904c7

Thanks!
Hey Gene,

These are json responses and you are responsible to run json_decode to convert into an array. Alternatively, use the method `getFieldValue`
·
Saturday, 18 July 2015 14:33
·
0 Likes
·
0 Votes
·
0 Comments
·
THANKS!. All I did was change
getFieldData($key)

to get FieldValue($key) and that solved EVERYTHING! Thanks
·
Saturday, 18 July 2015 23:00
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome.
·
Saturday, 18 July 2015 23:19
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post