-----
Action 1: Read file [file contains the number 1, which is returned as text.] Set file content to %file_contents. Variable %file_contents always contains a single value.
Action 2: Set Variable %id_number to variable %file_contents. Toggle Do Maths to true (checked).
If %id_number is 1,
Action 3: do nothing
else if %id_number >1
Action 4: add 1 to variable %id_number
-----
At this point, Action 4 throws an error stating %id_number is not data type number.
I assume %id_number is text because it was read from a plain text file. If that is true, %id_number should be converted to data type number.
I looked at the action Variable Convert. However, this action does not include an option to convert data type text to data type number.
How do I achieve converting data type text to a number without writing Java code? Writing code to do this transformation seems like it should be unnecessary.
It might help to export and post the human readable description of the profile or task. See https://redd.it/50u0vz for instructions if needed.
What you wrote doesn't make much sense to me.
> How do I achieve converting data type text to a number without writing Java code? Writing code to do this transformation seems like it should be unnecessary.
>
>
No converting necesary. If the only data in the variable are numbers Tasker will preform maths on it. I believe the issue you are having is when you read it from a file there is sometimes a hidden character in the text string. It is end of line or end of file or something like that.
just do a action / variable / test variable / length to see if it is there. Then do a variable section.
Thanks, Rich. It would have taken me a week to see that tree in the forest.