I am currently trying to import commerce products, which both essentially rely on the SKU column for both the SKU and Image fields.

This is being handled in Excel by cloning the column with ="import_images/"&A2&".png"

This means that the master list needs to be kept as an XLS and can't be kept as a CSV.

If tamper could handle the separation of similar source mappings, then obviously the image string could be constructed within Feeds Tamper, removing complexity from the import spreadsheet, and allowing the master list to permanently be a CSV.

If the client needs to juggle both XLS and CSV, I can see them damaging one of them, or not following the "rules" we would lay out for them, and I just think the less chance for client error the better :)

Comments

foopang’s picture

+1, I so desperately need it!

star-szr’s picture

I think the help text at the top of the Feeds Tamper page is very misleading in this aspect.

Configure plugins to modify Feeds data before it gets saved. Each mapping can be manipulated individually.

JamesChen’s picture

+1, I also need it!

JamesChen’s picture

I found one way to solve the issue. Add one 'Blank source' and map into a target in 'Mapping for Node processor'. Then, in the temper configuration, use 'Copy source value' to copy the source from the field you want to the target field. Finally, using any tamper plugin to tamper your target field. It will show one error message, but it works.

Summit’s picture

Hi, If this works is it than also possible to copy all information needed in the row to another SKU? With tamper. Say SKU new = SKU + 1 for a field which holds 2 colors. SKU 1 holds orange and the new build row with SKU 1 + 1 holds blue?
I will also file a specific issue for this, but may be this issue is somehow related? Separate issue http://drupal.org/node/1451632
Greetings, Martijn.

danon1981’s picture

+1
I need to be able to rewrite fields with "yes" into a taxonomie term for filtering further down the line. The node should just contain "yes" So I need to map 1 text field and 1 taxonomie field from 1 source.

danon1981’s picture

Might I suggest to add a checkbox to indicate which field the tamper plug-in is meant for.

ErnestoJaboneta’s picture

Subscribing
I also need this! I'm using mailhandler to import 8 fields from one source, the email body.

Dubs’s picture

Me also - I use a unique SKU which happens to be a mapping for a text Field too. However the SKU needs to be made up of a concatenation from another field. Tampering the two separately would be great.

czigor’s picture

OnkelTem’s picture

Looks like this will never be resolved, huh?

Whenever I try to use Feeds Tamper for more then just single-and-final editing of a source, I'm stuck for a hour or so, reviewing the issue queue, realizing it is probably impossible, and finally adding additional fields to a target Entity, and adding one more processing cycle but with Rules now.

Just a simple example, with which I failed again: I have "Title" source field, which keeps also "weight" of an item.
So I need exactly this mapping:

* Source.Title > Product.Title
* RegEx(Source.Title) > Product.Weight,

which, as far as I'm aware of it - is impossible to achieve.

With all the respect, @twistor, owhat forced you to implement tampering of just Source, not the Source->Target pair? :)

OnkelTem’s picture

Component: User interface » Code
codesmith’s picture

#4 worked for me - thanks!

twistor’s picture

This request would be nice, there have been others before, but it's not possible. The data does not exist in a pair, Feeds maps the source -> target. That's why the copy plugin exists, you can copy from one source field to another, then modify it independently.

acoronel’s picture

#4 works for me. Map from Blank Source to your desired field, then add plugins as desired. You can map as many Blank Sources as you need.

markabur’s picture

#4 works for me if this patch applied: #2131971: copy from source plugin using old variables

dakota.benjamin’s picture

Issue summary: View changes

@twistor but there is no way to do that if I don't have a spare/blank source to copy to, i.e. if I'm using the CSV parser.

twistor’s picture

With the CSV parser, you always have a spare/blank source. Just type in anything.

Bensbury’s picture

I've been trying different ways of doing this and followed #4 in Copying a Source ('From') into a Blank Source. However nothing comes in to manipulate. It doesn't copy anything.
I've noticed Feed Content might copy, but in this case the Source is 'Feed node: Node ID', and while it is available in the direct source->target tamper plugin, it won't copy.
Also if I use the PHP Tamper plugin and print out the contents of the $item array/object, 'Feed node: Node ID', is not present as an array property. So in $item it doesn't exist, which might explain why I can't copy it into other tamper fields.

Does anyone have a similar problem? And an idea what to do about it?
It just seems like certain sources (ones not part of the original feed itself) are not available for tampering.

msielski’s picture

Looking for this fix. Text "Each mapping can be manipulated individually," is incorrect should be "Each source can be manipulated individually."

zmove’s picture

+1 to this.

mibfire’s picture

For #4 it is important that the 'Blank source' has to come before the source field, cos if not the modified value will be used in the 'Blank source'!

RumpledElf’s picture

Mappings:

The field you want to use twice -> Temporary target 1
Blank source 1 -> field 1
Blank source 2 -> field 2
(in that order in the mappings)

Tamper:

Then use the tamper copy plugin on field 1 and field 2 to copy from temporary target 1
Then tamper away!

mautumn’s picture

Thanks RumpledElf - that worked for me :)

gaele’s picture

Status: Active » Closed (fixed)

I've created a documentation page based on #23.
https://www.drupal.org/node/2614786

firfin’s picture