You are here:  » Delete Field Content


Delete Field Content

Submitted by ChrisNBC on Tue, 2015-01-27 16:49 in

Hi David,

Hope all is well.

I need to delete the content of the product name field using a filter so that I can then rebuild the content of that field by concatenating product details. I had hoped to use the 'preg Replace All If else leave as is' filter I already have with the regexp (a-zA-Z) and nothing in the 'Replace' field but it does not work.

I wondered if you could suggest a good way to clear the content of a field each time all the filters have run? or if there is an existing filter which might do the job?

Thanks in advance.

Regards
Chris

Submitted by support on Tue, 2015-01-27 16:56

Hi Chris,

Have a go with the delimited expression:

/^.*$/

"^" is the beginning of line anchor, "$" is the end of line anchor, and ".*" matches anything in between.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by ChrisNBC on Wed, 2015-01-28 12:30

Hi David,

Thanks for your quick response. I have tried what you suggest above but the entire row appears to be dropped and not just the product name field emptied... I have also tried the filter "Search and Replace RegExp FIELD' but this also drops theentire record..I'm guessing the problem is the filter I'm using and not the regex. Please could you confirm if the filters I'm using with the regex are the correct ones? I'm running the filters as a final filter using 'zzzGlobalAfter'...not sure if this would have any bearing on the result?

Thanks in advance.

Regards
Chris

Submitted by support on Wed, 2015-01-28 12:49

Hi Chris,

It sounds like the 'preg Replace All If else leave as is' with /^.*$/ is working - but possibly that the subsequent filters to re-construct the name from other values is not working, resulting in the record being dropped because the Product Name field is now empty.

One way to double check is to temporarily remove the filter to delete the field content and let your other filters build up the value so that you can test that it is working correctly by seeing it appended or pre-pended to the product name. Once that's working OK, then re-apply the filter to delete the field content, and make sure it is sequenced to occur _before_ the other filters (or even very first, would be fine). I think you added the re-sequence mod which can be used to do this.

Hope this helps! Bear in mind an alternative to trying to use a filter to wipe out the Product Name value would be to register a field that is always empty as the Product Name if your feed has one. XML feeds always have an empty field as the document element e.g. "PRODUCT" so that might be an alternative...

Cheers,
David.
--
PriceTapestry.com

Submitted by ChrisNBC on Wed, 2015-01-28 14:50

Hi David,

Thanks, I had been testing without the filters to 'rebuild' the product names in place expecting to see a blank field in the product name field. I have added them in and all is working beautifully!...

Thanks again.

Best regards
Chris