Ui event text variable bug

Post your questions and help other users.

Moderator: Martin

Post Reply
houdinix64
Posts: 33
Joined: 08 Mar 2013 12:45

Ui event text variable bug

Post by houdinix64 » 02 Jun 2017 17:48

Im not sure if this is a bug or phone related problem.

Phone model: huawei p8 lite 2017, nougat
Automagic: latest version from playstore

The text variable generated by UI event: component clicked cannot be recognized.

Trigger: ui event component click
App = messaging

When I clicked one of my contact name in my inbox, text captured
text = GLOBE

I have a problem with the text variable, i cannot used it in my flows.
Attachments
flow_Flow3_20170603_013721.xml
(5.49 KiB) Downloaded 821 times

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Ui event text variable bug

Post by Martin » 02 Jun 2017 19:59

Hi,

What do you mean by text variable can not be recognized for UI Event? Does the trigger not provide the variable at all or does the variable contain the "wrong" value?

Your example flow is interesting. The left (Bad) branch assigns the text GLOBE that contains a few non-printable unicode characters so it's not visible in any text editor, however the string assigned to the variable text indeed is not the same like the one tested in the condition afterwards so I think this is not a bug.
You can make the characters visible with: text = replaceAll(text, '\\p{C}', '?');
or remove such characters with: text = replaceAll(text, '\\p{C}', '');

Regards,
Martin

houdinix64
Posts: 33
Joined: 08 Mar 2013 12:45

Re: Ui event text variable bug

Post by houdinix64 » 03 Jun 2017 00:07

Thanks Martin. Using text = replaceAll(text, '\\p{C}', '');
solved the problem.

The variable text contains the right value however you have to used the command above before you can normally used it in the flow. Sorry Im a newbee, no background in programming. :)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Ui event text variable bug

Post by Martin » 03 Jun 2017 19:25

No problem, I've never seen this issue myself and it is quite difificult to understand what might be going on. Maybe I could add an option to trigger UI Event to remove such values automatically when the flow is executed. I'm not sure if there's a good way to avoid the problem in scripts. Maybe pasting the value into a string literal could use the unicode escape sequences for the special characters so it would become visible at least.

Regards,
Martin

Post Reply