cancel
Showing results for 
Search instead for 
Did you mean: 

How to send multiple fields of a reference in Y2YSync

Former Member
0 Kudos

I am working on Y2YSynch project and my target type is CSV file.

I have a custom type 'MyCustomType' that has reference of product. My requirement is to generate CSV for MyCustomType that should have product code as well as product PK in addition to other fields of MyCustomType.

I have created Y2YStreamConfiguration for MyCustomType and provided Y2YColmnDefiniton for product code as well as product PK in it.

When I try to sync, the export fails with 'ambiguous attribute' exception.

It works fine if I use only one of the product attribute product code or product PK.

When I send both fields value in single attribute product(code, PK). Y2YSync works but values comes as : <product code>:<product PK>.

Accepted Solutions (1)

Accepted Solutions (1)

former_member224482
Active Contributor
0 Kudos

Short answer : No you cannot.

The Y2Ysync was designed to create export definition which are also import definition. Both of these definitions must be compliant with ImpEx .

export fails with 'ambiguous attribute' exception.
As you defined the same attribute twice in your header (because you want 2 separate columns for the same referenced item), during an ImpEx import it would be ambiguous to know which of the 2 values is referencing to the product.

Y2Ysync was not designed to achieve pretty printing of the value for export scenario only (Import is always validated). This is one of the reason you should use Data Hub or any other inbound code (split the string by ':') which allow you to modify the values provided.

Answers (1)

Answers (1)

Former Member
0 Kudos

Please have a look inside y2ysyncdemoelectronics which shows a working configuration for synchronizing a catalog. From projectdata-streams.impex I just picked up the impex header config for the Product.baseProduct attribute, which is also a reference to another product.

 baseProduct(code, catalogVersion(catalog(id), version))

As you can see a product reference requires all unique attributes (code, catalogVersion) in order to be unique.

Cheers Axel

Former Member
0 Kudos

@Axel, thanks for your reply.

Well, the issue is that we are not sending product data to data hub at least in the current phase of the project. So, data hub does not have the product data.

I just need couple of product fields while generating CSV for MyCustomType.

Of course, I can send product(code, PK) and at the data hub side I can split the string by ':' as this kind of value coming as ':' separated.

I just wanted to know if there is some other way of sending those product fields as part of MyCustomType.