KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


2 posters

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Fri Aug 16, 2019 3:00 pm

    Hi all

    I am having problems with trying to compare and text to scrape text. The text works fine and test variables. When its successful goes onto return the iterations of rows. the page has 84 records but only scrapes 54. I am trying to scrape all 84 with blank column data if a match isnt found. For some reason so far just writes the successful matches only.
    How do i include all 84 rows with and without matches? I thought it would be just if its not successful branch before test variables and return value. All i am getting though is double the record amount or 54 with duplicates.


    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. OubdnqhzIEAAAAASUVORK5CYII=
    I will also be adding another column of data called priority. These are just numbers. The idea is to apply a score IF the numbers are between 1 to 10 = 1, 11 to 20 = 2, 21 to 30 = 3 and so forth. I have no idea how to do this.

    Any help would be greatly appreciated. It's only been a few days using this app and i think it's pretty amazing!

    Cheers

    Madprof


    Last edited by madprof1 on Fri Aug 16, 2019 4:48 pm; edited 1 time in total
    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Fri Aug 16, 2019 3:03 pm

    Addition the scrape numbers are from a text file which has all the extra data to test and write if extract source is a match. Priority column is for the simple maths if its between multiple numeric thresholds and outputs a simple number.
    batman
    batman


    Posts : 47
    Points : 1922
    Join date : 2019-03-19

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by batman Fri Aug 16, 2019 3:42 pm

    Can you also share the screenshot from the end of your robot, it seems to have been cut off

    A few thoughts..
    Robots will always backtrack unless you end them, they work from left to right and then work backwards through any branches that haven't been executed
    In loops you need to consider the use of global variables. Variables get reset on each iteration so if you need to retain values make sure you set your variable as global
    When using a test after a try step make sure you have your error handling setup correctly on the test action. Disable log as errors and select try next alternative - this will force your process down the alternative path if the test fails
    If returning values, make sure there is a return step for each possible path the robot can take.. either re-join your workflow before the return value action or have multiple return steps.
    Use the debug tab to step through the process, you can breakpoints to stop the process at any point and see the current state of all variables, sessions etc. Step through a record that isn't behaving correctly and see where the flow takes you
    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Fri Aug 16, 2019 3:49 pm

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. CqOxuacgWEWBxvdafxIEQRAEQRAE0YeDwoAgCIIgCIIgCAoDgiAIgiAIgiAoDAiCIAiCIAiCCAeFAUEQBEEQBEEQFAYEQRAEQRAEQVAYEARBEARBEAQRDgoDgiAIgiAIgiAoDAiCIAiCIAiCoDAgCIIgCIIgCCIcFAYEQRAEQRAEQVAYEARBEARBEARBYUAQBEEQBEEQRDgoDAiCIAiCIAiCoDAgCIIgCIIgCILCgCAIgiAIgiCIcFAYEARBEARBEARBYUAQBEEQBEEQBIUBQRAEQRAEQRDhoDAgCIIgCIIgiD4fIv8fzi7C2A0ZbjsAAAAASUVORK5CYII=
    batman
    batman


    Posts : 47
    Points : 1922
    Join date : 2019-03-19

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by batman Fri Aug 16, 2019 4:22 pm

    Assuming your test variable action has "Try Nearest Alternative" set on the error handling tab then you should be hitting the return step for every row that matches the criteria in your For Each Tag/Text part loops

    I'd suggest stepping through the robot in debug mode. Run it through to a record that isn't behaving correctly and check that your 2 for loops are behaving as expected, it could be that those records are not matching the criteria you have set against them and therefore move onto the next iteration without executing the subsequent steps.

    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Fri Aug 16, 2019 4:53 pm

    thanks


    Last edited by madprof1 on Sun Aug 25, 2019 2:30 am; edited 1 time in total
    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Fri Aug 16, 2019 4:55 pm

    The above bot does only successful matches. There should be 84 records. 45 to 54 generally match. The rest of the datarows AFTER time should be blank for priority, tags. I have tried so many things. I might make it worse. If someone with experience can edit this bot it would help in alot of bots. Branching even with try + alternative just ends up with thousands of duplicated event rows or double duplicates. Not sure what to do.
    batman
    batman


    Posts : 47
    Points : 1922
    Join date : 2019-03-19

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by batman Sat Aug 17, 2019 12:03 am

    Hi,

    I'm not sure this is the most efficient way of doing things or even if I quite understand what you are trying to do here but maybe this will help..

    I'm assuming you want a result for every link on that web page, if you find a match against your internal file then it sets the priority/tag otherwise it still returns a record but with those values blank

    Set the error handling on your test variables step - Disable errors, and select Next Iteration (this will continue working through your results until a match is found or it gets to the end of the file)
    Added an additional variable called matchfound - Set this to true if a match is found
    Added an extra branch before your for each text part - all links on the website will eventually go down this path
    Add a try step here with a test to see if a match was found
     - If true reset the value of the match found to false (for the next iteration of the web loop)
     - If false reset your priorty/tag results to blank and return the value (this will ensure a result for every link and blank values for priority/tag when no match is found)

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Robot10
    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Sat Aug 17, 2019 1:43 am

    Yep thats right. scrapes everything matches and non matches.  thanks so much!
    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Sat Aug 17, 2019 2:00 am

    Hi Batman could you send the file or upload it somewhere please. I keep getting events duplicating or doubling up the rows.
    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Sat Aug 17, 2019 2:05 pm

    How about scraping the 84 results first. Then updating the rows after with a match and insert?
    avatar
    madprof1


    Posts : 10
    Points : 1738
    Join date : 2019-08-16

    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by madprof1 Sat Aug 17, 2019 4:35 pm

    Thanks batman got it to work. You a champ.

    Sponsored content


    Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only. Empty Re: Having trouble with alternative TRY or branching. Ending up with duplicate rows or just successful matches only.

    Post by Sponsored content


      Current date/time is Sun Apr 28, 2024 4:13 am