Page 1 of 1
Appending info to a property value
Posted: Thu Nov 20, 2008 12:44 pm
by CouchPotatoe
I'm trying to add some data onto the end of an existing property value (actually the call duration for a completed call) -so in the task I have updated the value of "PropertyName1" which is "John Smith" with
%%PropertyName1%% (%%PropertyName2%%)
intending to append the call duration but the result is that the new value contains the property name rather than the value ie
%%PropertyName1%% (10:20) rather than
John Smith (10:20)
Is there a way around this ?
K
Re: Appending info to a property value
Posted: Thu Nov 20, 2008 3:16 pm
by Osler
Have your task call this script. Just fill in the <Device Name> with your device name.
Code: Select all
Option Explicit
Dim PropertyUpdate
PropertyUpdate = GetPropertyValue("<Device Name>.PropertyName1")
PropertyUpdate = PropertyUpdate & " (" & GetPropertyValue("<Device Name>.PropertyName2") & ")"
Call SetPropertyValue("<Device Name>.PropertyName1", PropertyUpdate)
Osler
Re: Appending info to a property value
Posted: Thu Nov 20, 2008 7:19 pm
by CouchPotatoe
Thanks Osler - I'll give that a try..
However I'm also now thinking it might be a different problem as values from other properties are being substitued as their name ie %%property.name%% rather than the property value. I'm selecting them via the task editor dialogs. I wonder if its something to do with specific plugin properties or naming... I'll report back...
eg here's a value and each of the three properties used have their own values.
%%CID.Direction.xAP BSC Text%% : %%CID.Time.xAP BSC Text%% %%CID.Duration.xAP BSC Text%%
should display
OUT: Friday 12:22 23:56:00
but displays the names as per 3 lines above
K
Re: Appending info to a property value
Posted: Fri Nov 21, 2008 8:32 am
by ScottBot
The problem you are seeing is due to the fact that either the Device or Property name you are using in the substitution contains a period (.). The logic that parses out the Device and Property names in the substitution string uses the period as the delimiter. Since there is more than one period in the substitution string, it incorrectly handles that case.
Re: Appending info to a property value
Posted: Sat Nov 22, 2008 10:25 am
by CouchPotatoe
What would be the best thing to do about this Scott ? The device names, and property values are being auto created (in this case by the xAP plugin) based on the the original names which will always have the '.' character in them - and at least two of them :-(
Is it possible to change something in HouseBot to avoid this, perhaps using a more unusual delimiter (non printable ?) or should we rewrite the plugin to strip out the '.' characters and replace them with something else ? I'm not quite sure what though as the '.' is our key hierarchical delimiter and all other printable ASCII characters are permitted in xAP source names.... and we would have to resubstitute the '.' characters in order to correctly address the xAP devices for control...
K
PS Will this cause issues in scripted changes too ?
Re: Appending info to a property value
Posted: Sat Nov 22, 2008 4:12 pm
by ScottBot
The best thing would probably be for the server to do a better job in determining what the device name is in these cases. It just assumes that everything is Device.Property. I imagine you are seeing error messages about the Device not being found when the substitution occurs. In these cases the server should see if there are multiple periods and try and parse the combined name.
Unfortunately, I just released 3.30 last week, so an update won't be available for a while.
Re: Appending info to a property value
Posted: Thu Nov 27, 2008 2:07 pm
by CouchPotatoe
The timing wasn't brilliant was it
If you do get an opportunity to change this then making it to a subsequent beta will suffice for me.
Cheers Kevin
Re: Appending info to a property value
Posted: Sun Nov 30, 2008 8:55 am
by ScottBot
It will be fixed in the next maintenance release. I'll try and get you a preliminary copy so you can test it out.