I have Custom Data and i want to set into device name , Can I?
I have Custom Data and i want to set into device name , Can I?
Of course via legacy script:
Hi,
Above legacy script worked well. In addition to;
I'm using JS method as well. It's working well on my environment, please see the syntax as following:
But you can't use custom data there just a predefined string which is not what he has requested @Zafer. Especially if the user needs to enter something on the device to define naming and maybe relocation as well.
Hi @Rafael,
Thank you for your reply. I think, I get the request. Custom data works reading a file from the device, so what we can do:
- We can read the file directly from the device by using a JS, so this way we can know what is the value of the custom data
- And then we can use this data as a variable and change the device name. Example as following to read value from the .ini file from the device to device it's custom data value.
var count = new mobicontrol.io.File('/sdcard/Download/user_name.ini');
var text_read = count.readText();
mobicontrol.log.info('Read info is:' +text_read);
I've done some automation process by using a similar method earlier. If this does not makes sense please let me know
Zafer
To verify it's working by using a variable it can be quickly tested only using below as well:
Ok, thats true you can pick the data from the ini or xml file directly.
To be honest haven't had that in mind before, sorry for that.
Doing it that way i need to agree you can do it using JS as well ;)