Hi
I use the Notification on Statusbar action type, and would like to add actions (buttons) to the notification, where the button-text, and also the button-action itself, is derived from parameters.
Example notification:
Message="Missed call from {phone_number}"
Action icon: Call
Action text: "Call {phone_number}"
Action to execute: Call Number: {phone_number}
So long as {phone_number} is a present variable, my notification looks correct. The phone number is present on the message, and on the notification action-button itself. But when I actually click the button to execute the Call Number action, it is passed an empty string so the phone attempts to dial an empty number. It looks like parameters are not supported for notification button "action input".
Tested on HTC One M7 running Automagic Premium 1.27.0 / Android 5.0.2 / HTC Sense 6.0.
Notification on Statusbar, Actions with parameters
Moderator: Martin
Notification on Statusbar, Actions with parameters
- Attachments
-
- Screenshot showing the notification configuration, except with {sms_recipient} variable.
- Screenshot_2015-03-12-08-43-29.png (239.4 KiB) Viewed 8780 times
Re: Notification on Statusbar, Actions with parameters
Hi
You are right, passing variables to an action is currently not supported. You could store the variable temporarily in a global variable so the action can access the variable when it's executed. This has the disadvantage that it will not work properly when you are using the same global variable in multiple actions or multiple notifications.
You could also use the label to pass the value to the call action.
Label of the action would stay: Call {phone_number}
The action would become:
Call Number: {substring(action_text, 4)}
The variable action_text contains value Call 12345, function substring extracts the part after Call .
Theoretically it should be possible to extend Automagic so that variables can be passed directly to the action. Let me add this to the todo-list.
Regards,
Martin
You are right, passing variables to an action is currently not supported. You could store the variable temporarily in a global variable so the action can access the variable when it's executed. This has the disadvantage that it will not work properly when you are using the same global variable in multiple actions or multiple notifications.
You could also use the label to pass the value to the call action.
Label of the action would stay: Call {phone_number}
The action would become:
Call Number: {substring(action_text, 4)}
The variable action_text contains value Call 12345, function substring extracts the part after Call .
Theoretically it should be possible to extend Automagic so that variables can be passed directly to the action. Let me add this to the todo-list.
Regards,
Martin
Re: Notification on Statusbar, Actions with parameters
Cool, the action_text substring workaround does the trick for me. Thanks a lot and keep up the great work!
Re: Notification on Statusbar, Actions with parameters
Passing variables to the executed actions should work in the next EAP-version which should be released in about a week or two in the EAP-forum.