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.


Please, help me with simple robot

Share

timoh.in

Posts : 1
Points : 125
Join date : 2018-07-16

Please, help me with simple robot

Post by timoh.in on Fri Jul 27, 2018 12:42 am

Hi guys.
I want to make a robot which will extract number in the DB and while robot run every time check if number present in DB -> Do nothing if number not present in DB - add new row.
Please help me with this simple robot logic.

There is a robot


But in debug mode The Kapow System shows me 2 result (duplicated) instead of one.


I expect : one result
avatar
Shyam Kumar
Ranks

Posts : 108
Points : 2144
Join date : 2013-07-05
Location : Kerala, India

Re: Please, help me with simple robot

Post by Shyam Kumar on Tue Jul 31, 2018 11:18 am

Hi,

In my understanding you need to extract and store unique number into DB, and if the number is already available in DB you need to skip that number and store the next..
Here you can use various options based on your logic.

here one example,

IMG-1:
Robot review


IMG-2:
In the query database action step checking the duplicate.
Here select the database, and select count to a temporary variable.
Here Vahicle_Details is a table and vahicle_number is the field in this table. check this field to extracted value(here:vahicle_number)
then map the variable (actual_duplicates ->duplicate)



IMG-3:

using test variable test the temporary variable(duplicate), if the variable="0", there is no entry with this number in DB and it will store in next row. else skip this number and loop the next number..




Hope you understood.


Thank you.

Regards,

Shyam kumar

leedle

Posts : 18
Points : 132
Join date : 2018-07-31

Re: Please, help me with simple robot

Post by leedle on Wed Aug 01, 2018 5:43 am

I can't understand the way you wrote your logic, is this what you are trying to say?

if num in db:
    do nothing
else:
    store in db


If that is what you were trying to say, use a try step where you have the branch point and change the error handling on the 'find in db' to 'try next alternative', then move the 'store in database' to the branch created by the try step. Delete the second branch you have entirely.

The reason it stores twice, is because the error handling is set to 'ignore and continue'. AKA no matter what errors occur, it is going to continue.
avatar
Shyam Kumar
Ranks

Posts : 108
Points : 2144
Join date : 2013-07-05
Location : Kerala, India

Re: Please, help me with simple robot

Post by Shyam Kumar on Wed Aug 01, 2018 11:38 am

Hi Leedle,

Here I am implemented the logic same you mentioned

Extract Number   //Extract Vehicle Number in the attached screen short

If Number in DB:  //Query Database in the attached screen short
    do nothing     //Next Iteration in test duplicates in the attached screen short
Else:
    Store in db 
   //Store in database in the attached screen short

Here I am tried to just say the logic only, that's why I am using next iteration in test duplicate (Test Variable) action step.
If you need to store/update the number already in DB you can use try step. here I used to skip those numbers.
If you are implement this logic it does not stores the number twice.

Thank you

Regards,
Shyam kumar

leedle

Posts : 18
Points : 132
Join date : 2018-07-31

Re: Please, help me with simple robot

Post by leedle on Wed Aug 01, 2018 9:46 pm

Shyam Kumar wrote:Hi Leedle,

...

Thank you

Regards,
Shyam kumar

Hey Shyam, just read your solution, and it definitely works for OP's problem. In my original post, I meant that I could not understand OP's question, not your solution.

Sponsored content

Re: Please, help me with simple robot

Post by Sponsored content


    Current date/time is Thu Nov 15, 2018 12:05 pm