# Log value of DeviceID

**URL:** <https://forum.genieacs.com/t/log-value-of-deviceid/329>\
**Category:** Uncategorized\
**Created:** [October 3, 2019, 12:27pm UTC](https://forum.genieacs.com/t/log-value-of-deviceid/329 "2019-10-03T12:27:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gittela](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@gittela](https://forum.genieacs.com/u/gittela)\
**Post date:** [October 3, 2019, 12:27pm UTC](https://forum.genieacs.com/t/log-value-of-deviceid/329/1 "2019-10-03T12:27:34Z")

</div>

gaah! I need some help from those of you who actually know how to code…

_log (“productclass check”);_  
_const now = Date.now();_

_let productclass = declare(“DeviceID.ProductClass”, null, {value : now });_  
_log(productclass.value);_  
_log (“productclass check done”);_

This works kinda, but returns more than I’d want to(I’ve cat’ed the output somewhat) :  
Script: productclass check  
**Script: Polar,xsd:string** \<- This! I’m trying to get the string value without “,xsd:string”  
Script: productclass check done

**EDIT** : I figured it out when I read the old docs…

log (“productclass check”);  
const now = Date.now();  
let productclass = declare(“DeviceID.ProductClass”, {value: now}).value[0];  
log(productclass);  
log (“productclass check done”);

---

<div class="post-metadata">

**Author:** ![gittela](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@gittela](https://forum.genieacs.com/u/gittela)\
**Post date:** [October 4, 2019, 7:26am UTC](https://forum.genieacs.com/t/log-value-of-deviceid/329/2 "2019-10-04T07:26:20Z")

</div>

To expand on this:  
What kind of JS methods are available in the provisions? I thought about using trim() or replace(), but these aren’t available (or, I’m not a coder and don’t know how to do it…) 🙂

I guess I can do it with a regex somewhere, but is there a simpler way? I’m using it as a proof of concept in the example above, I just wanted to see what was actually returned in order to use it in functions to check the state of a cpe.
