Page 1 of 1
When do you have to initiate variables?
Posted: 24 Feb 2014 14:21
by angelatwork
Hi,
I do not quite understand when you have to initiate variables and when you don't. I am talking about the ones you have supplied us with, not my own handmade variables.
It seems that I can use for example contact_name without initiating it when having incoming/outgoing call as a trigger? But I guess that if I use call_cashed_name I have to initiate it since you have the action Init Call Log, or don't I?
Also I wonder if you build a flow or use an app that tries to find the name of unknown caller, it will not be stored in the variable contact_name since the person is not in my contact list, but will it be stored in call_cashed_name?
Hoping for an answer
Re: When do you have to initiate variables?
Posted: 24 Feb 2014 17:43
by Martin
Hi,
Automagic initializes variables either in the trigger at the time the flow is started or in the condition resp. action as soon as the condition/action is executed.
Take following flow for example:
-trigger Incoming Call
-condition Debug Dialog
--> true: -action Init Variables Call Log
-condition Debug Dialog
The trigger will initialize the following variables: triggertime, incoming_number, call_state, call_missed_rejected, contact_name, contact_company and some more. The condition shows a dialog with the variables and the corresponding values.
Action Init Variables Call Log will initialize some more variables like call_time, call_cached_name etc. at the time when the action is executed so the second condition Debug Dialog will show the variables of the trigger and the variables provided by the action.
The variables provided by a trigger, condition or action are listed in the help page of the object ([?]-icon on the upper right side when editing the trigger/condition/action). Scroll down to the variables section.
The variable call_cached_name provided by action Init Variables Call Log usually also contains the name of the caller available in the contacts so it will not contain a name for an unknown caller. Some phones might not return a value at all in the call_cached_name variable since the call logs are heavily modified by some manufacturers. The call log can also contain outdated information for the caller name when the call was made a long time ago and you have changed the name of the contact in the meantime (hence the name cached).
If you have an app that finds the name of an unknown caller, you might have a chance to access this name when the app modifies the call log accordingly.
Regards,
Martin
Re: When do you have to initiate variables?
Posted: 24 Feb 2014 21:13
by angelatwork
Thank you for you clarifying explanation,
maybe I can use the variable missed rejected calls then to avoid logging those calls which I asked about in the other question?
Thanks