# Return Values from Picked Entity

**URL:** <https://community.cesium.com/t/return-values-from-picked-entity/3330>\
**Category:** CesiumJS\
**Created:** [November 17, 2015, 7:25pm UTC](https://community.cesium.com/t/return-values-from-picked-entity/3330 "2015-11-17T19:25:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kihana\_Mixon](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@Kihana\_Mixon](https://community.cesium.com/u/Kihana_Mixon)\
**Post date:** [November 17, 2015, 7:25pm UTC](https://community.cesium.com/t/return-values-from-picked-entity/3330/1 "2015-11-17T19:25:38Z")

</div>

If I'm using scene.pick(clicked.position) to access entities loaded via a (currently) single CzmlDataSource, how can I then access the properties of the entity? More precisely, how can I access the positions property if the clicked entity is a polyline? I know that I can update/change the properties, but I want to know what the actual data is instead of returning [object Object] for all of the properties.

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [November 17, 2015, 7:41pm UTC](https://community.cesium.com/t/return-values-from-picked-entity/3330/2 "2015-11-17T19:41:26Z")

</div>

Hello,

Here is an example of how to get the positions of the polyline from a pick. This prints out the current positions to the console:

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);  
handler.setInputAction(function(click) {  
var pickedObject = viewer.scene.pick(click.position);

```
if (Cesium.defined(pickedObject) && (pickedObject.id)) {
    console.log(pickedObject.id.polyline.positions.getValue(viewer.clock.currentTime));
}

```

}, Cesium.ScreenSpaceEventType.LEFT\_CLICK);

``

To set the positions to a new value, you can do

pickedObjects.id.polyline.positions = Cesium.Cartesain3.fromDegreesArray([lat, lon, lat, lon,…);

``

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![Kihana\_Mixon](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@Kihana\_Mixon](https://community.cesium.com/u/Kihana_Mixon)\
**Post date:** [November 17, 2015, 7:50pm UTC](https://community.cesium.com/t/return-values-from-picked-entity/3330/3 "2015-11-17T19:50:39Z")

</div>

Thank you, I had forgotten about the getValue() function!

---

<div class="post-metadata">

**Author:** ![Kihana\_Mixon](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@Kihana\_Mixon](https://community.cesium.com/u/Kihana_Mixon)\
**Post date:** [November 17, 2015, 10:17pm UTC](https://community.cesium.com/t/return-values-from-picked-entity/3330/4 "2015-11-17T22:17:13Z")

</div>

I do have another question, how do I get the id of the picked entity if I have the following?

&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"id":"Polyline\_1",  
&nbsp;&nbsp;"name":"Polyline 1",  
&nbsp;&nbsp;"polyline": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"width":3,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"material": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"solidColor": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"color": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"rgba": [255,255,255,255]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"positions": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"cartographicDegrees": [-75, 37,0,-125, 37,0]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;}

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [November 20, 2015, 3:34am UTC](https://community.cesium.com/t/return-values-from-picked-entity/3330/5 "2015-11-20T03:34:44Z")

</div>

You can get this using pickedObject.id.id.

pickedObject.id is the entity, so pickedObject.id.id will be equal to the entity id provided in the CZML

-Hannah
