Macrodroid: Convert "+63" area code to "0"
I am not sure what went wrong at your end, it could be wrong configuration, misuse of global variables or a silly mistake. In the absence of trouble shooting information, it's a guessing game.

Your approach of changing 63 to 0 as in the title is totally unnecessary.


Macro Logic

Outgoing call number is assigned to local variable A as a string (don't use global variables unless you need)

The length of the string in variable A is assigned to variable strlen. We have two types of outgoing numbers, those starting with +63, which is 13 digits long and the other starting with 09 that is 11 digits.

We use IF-then-ELSE logic. If the string length is 13 (corresponding to numbers starting with +65):


a) We use text manipulation to find out the first six digits to find out whether they are allowed codes or not. In either case, they are assigned to variable A.
b) If the first 6 digits are allowed codes, no action is taken. If they aren't a warning dialogue is configured. This is done by the nested IF loop and can be extended to include more area codes.

Back to step 2,if it is not 13 digits, then actions in else loop will be carried out. We are looking at 11 digits corresponding to 09 starting numbers. But by saying not 13,we are also including other cases like police, fire etc., which have 3 digits and for which the warning will still pop up and the effort to exclude this 3 digit case is not worth it IMO.

For 9 digit numbers, the same set of actions at Para 3a) and b) are executed.

At the end both variables are initialized


Macro is slightly long owing to comments, so it's in two screenshots, the first one covering IF and next one ELSE


(Click to enlarge)
OP has confirmed it works as expected. To prevent MacroDroid being killed follow instructions at don't kill my app.com