hide some text from key value

Post your questions and help other users.

Moderator: Martin

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

hide some text from key value

Post by Rafi4 » 08 Jul 2019 15:11

hi all
I think this is may not possible. if key value is(in map) "today is 8th July". how can I ignore the text "today is"?
I want to get only the text "8th July" in Statusbar .

thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: hide some text from key value

Post by Desmanto » 08 Jul 2019 16:33

Using key in map require exact match. If you need only partial match, you need to loop upon the key and can use either regex or simple contains(). I don't know yet, how you want to ignore the text "today is". Do you mean to search for "today is" and then remove it from the search result, or do you mean to search only for "8th July" in the key and then remove any other text from the key, which is not the keyword?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: hide some text from key value

Post by Rafi4 » 08 Jul 2019 20:14

hi desmanto
because I want to using this flow for multiple reminders. working very amazing and fantastic. not only one I am creating reminders more than one with one global variable date and time.now i am saying that triggertime is the map key and key value is triggertime ++ my reminder. in notification I am getting triggertime +reminder . I want to ignore the triggertime in notification.

for example =
map key = triggertime
key value = triggertime pay electricity bill (my reminder).

I want to get the pay electricity bill text in notification. I want to ignore the text triggertime in notification.


thanks from record4
Attachments
flow_group_REMINDER.xml
multiple reminders
(55.35 KiB) Downloaded 587 times

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: hide some text from key value

Post by Desmanto » 09 Jul 2019 17:07

That is one smart way to use the glovar map with glovardt. It saves you tons of glovar and allow multiple glovardt addition.

Actually you can ignore the triggertime part using regex. But instead of solving the problem, why don't just create the map as you want from the beginning.
From the create reminder flow, you have the script

Code: Select all

schedule=value;
addMapEntry(global_4,schedule,"{schedule}  {note}");
You add the {schedule} inside the value. If you don't add it, you can have the {note} alone when using the glovar. The Script will become

Code: Select all

schedule=value;
addMapEntry(global_4,schedule, note);
This doesn't affect your glovar key, it simply affect the value. And you only need to save the note, as the triggertime already included in the key (so no need to save it twice).
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: hide some text from key value

Post by Rafi4 » 09 Jul 2019 18:18

hi desmanto
I want to get the reminder Note by sorting the values. so I need the triggertime in note key value.

thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: hide some text from key value

Post by Desmanto » 09 Jul 2019 18:24

But you sort the key, not the value. Since the key contains the schedule time too, then you already get what you need by sorting the key, no need to sort the value anymore.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: hide some text from key value

Post by Rafi4 » 10 Jul 2019 01:12

hi desmanto
because I want to convert the key value into global variable date and time.
thanks from record4

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: hide some text from key value

Post by Desmanto » 10 Jul 2019 17:29

You need the glovar datetime, but that glovar datetime already provided by the key, not the value. Just try to remove the {schedule} and test to create a reminder and see how it works out.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: hide some text from key value

Post by Rafi4 » 12 Jul 2019 08:15

hi desmanto
I can't understand much. please modify the flow and post.

thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: hide some text from key value

Post by Desmanto » 14 Jul 2019 15:15

I can' test your flow, since you have other glovar depend on it too. You simply have to edit the script at the flow Create Reminder, it is the 5th element, after the expression. Remove the {schedule} as shown at my post 4.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply