Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Posts
    3,203

    Default Pre-Release News

    I wanted to post a few of the changes here. Not only does it help get the word out but also reminds me to address the changes in the docs. haha

    Another Automation Update.

    Loops, if you don't know, is a way of taking a collection of items and checking each individual item within the loop.

    So if you have a collection of emails, you can loop through each email and check for a subject line. The way the loop, within automation works is it sets the the item (an email in our example) to a variable called CurrentItem. Then you can pull actions over like Get Subject and set the variable.

    All works great up until we get into scenarios like going through XML.

    This is similar to a clickbank rss feed that they put out for new products.
    <MainPage>
    <Category Name = "Arts">
    <Site> Site One </Site>
    <Site> Site Two <Site>
    </Category>
    <Category Name = "Software">
    <Site> Site Three </Site>
    <Site> Site Four <Site>
    </Category>
    </MainPage>

    So if were to try and get all the sites, from that XML, we would need to loop through all the categories. Within that loop, we need to then loop through all the sites.

    So we have something that looks like this.




    Now you have two loops that are setting two different variables with the same name "CurrentItem". Now we have a problem. While it still works, we are going to be confused as to which "CurrentItem" variable we need to select when we add other actions.



    That is why I added the CurrentItem field, under Click for Options, on the loop designer. You can now change the name. In the first loop I would change the name to "CurrentCategoryItem" to better reflect what type of data that variable will have. Then I will drag my other loop that I will use to go through all the sites, for that category, and rename the CurrentItem variable to "CurrentSiteItem". Now when I am clicking the Options link and selecting my variables I will know which is which.

    I recommend changing the "CurrentItem" name when you drag it onto the script. When changing variable names it will go through and update your script based on that name. So two actions with the same name will cause issues if you rename one of them.




    Thomas

  2. #2
    Join Date
    Dec 2014
    Posts
    260

    Default

    Nice addition, Thomas. That will make it a lot more manageable using those loops and sub-loops (I guess we could call them that).

    Mel

  3. #3
    Join Date
    Dec 2008
    Posts
    3,203

    Default

    Quote Originally Posted by Mel Bel View Post
    Nice addition, Thomas. That will make it a lot more manageable using those loops and sub-loops (I guess we could call them that).

    Mel
    You may find your scripts containing loops within loops within loops. Especially when you have to parse things like xml.

    That Clickbank rss feed has categories within categories.


    Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may edit your posts
  •