AutoLocation Deleting geofence that has a keyword

Discussion in 'AutoApps' started by tiagoasazevedo, Mar 31, 2020.

  1. tiagoasazevedo

    tiagoasazevedo New Member

    Joined:
    Mar 31, 2020
    Messages:
    2
    Likes Received:
    0
    I want to create a project that programmatically creates and removes geofences using AutoLocation. Creating is easy and so it is removing if the idea is to remove a geofence with a specific name. However I wanted to remove every geofence with a keyword on it, like for example *wifi*.

    Is it possible? Because so far I haven't managed to get it done because the geofences with wifi are not deleted.
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hi. If you use the AutoLocation Manage action you can list all your geofences but leaving the configuration empty. Then in Tasker you can loop through the list :)
     
    tiagoasazevedo likes this.
  3. tiagoasazevedo

    tiagoasazevedo New Member

    Joined:
    Mar 31, 2020
    Messages:
    2
    Likes Received:
    0
    So I tried your advice and I ran the AutoLocation Manage action to list every geofence. However it only listed the very first geofence when I tried to store it on a variable.
     
  4. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    Try this:

    Code (Text):
    Geofence Remove (856)
        A1: AutoLocation Manage [ Configuration:Only getting Geofence info Timeout (Seconds):10 ]
        A2: For [ Variable:%index
        Items:1:%algeofence(#) ]
        A3: Variable Set [ Name:%geofence_to_remove
        To:%algeofence(%index)
         Recurse Variables:Off
        Do Maths:Off Append:Off
        Max Rounding Digits:3 ]
        If [ %algeofence(%index) ~ *wifi* ]
        A4: AutoLocation Manage [ Configuration:Geofence
        Name: %geofence_to_remove
        Action: Delete
        Timeout (Seconds):10 ]
        A5: End For
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Thank you! :)
     

Share This Page