Replace empty fields with default value

Questions and answers about anything related to Helium Scraper
Post Reply
yeti
Posts: 22
Joined: Sat Feb 02, 2013 1:01 am

Replace empty fields with default value

Post by yeti » Sun Feb 03, 2013 2:41 am

Hi there.

I think I have just about managed to figure out most of the functionality now and I can see how powerful the software is. Really good.

One thing I would like to do, which I hope you can help me out with is:

Let's say I scrape 100 pages and 90 of them have telephone numbers, but 10 don't. Currently this leaves an empty field in the DB.

Is there something I can do so that if a value is found then it grabs it, but if a value is not found, then it is replaced by a default value (e.g 'tbc')?

Thanks in advance.

yeti
Posts: 22
Joined: Sat Feb 02, 2013 1:01 am

Re: Replace empty fields with default value

Post by yeti » Thu Feb 07, 2013 1:47 am

Is there any way this can be done? my trial runs out in a couple of days and I am keen to test fully before purchasing.

Thanks a lot.

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Replace empty fields with default value

Post by webmaster » Thu Feb 07, 2013 6:17 am

You can use a If / While premade at File -> Online Premades. Duplicate your Extract action and run one if your kind if found and the other one if the kind is not found. On the other one, instead of your kind, use the BODY kind and as property use a variable with the value you want to use as default. You can create the variable at Project -> Variables.
Juan Soldi
The Helium Scraper Team

Post Reply