cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to escape character from impex?

Former Member
0 Kudos
8,173

Hi All,

Could someone help me how to escape characters like comma,semicolon,colon,backslash etc ?

Thanks, G Gopinath.

View Entire Topic
arvind-kumar_avinash
Active Contributor
0 Kudos

You do not need to escape : or , or backslash e.g. the following ImpEx will pass for all the records mentioned below:

 $productCatalog=Default
 $catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
 
 INSERT_UPDATE Product;code[unique=true];$catalogVersion
 ;myCode:myID;
 ;myCode,myID;
 ;myCode\myID;

For escaping smicolon( ; ), you need to put it inside double quotes e.g.

 $productCatalog=Default
 $catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
 
 INSERT_UPDATE Product;code[unique=true];$catalogVersion
 ;"myCode;myID";

In addition to these characters, you can escape ' and " by doubling them. Please check https://wiki.hybris.com/display/release5/ImpEx+Syntax for more information.

Former Member
0 Kudos

Hi ,

I am getting data from json response like the below:

 "AddressLine1": "7602, \"CHAMUNDA ESTATE\",",
 "AddressLine2": "Nr. Ramol Cross Roads, G.I.D.C., Phase-I",

May know how to escape them?

Thanks, G Gopinath.

arvind-kumar_avinash
Active Contributor
0 Kudos

Can you please write it in the ImpEx format? e.g.

 INSERT_UPDATE item-type;code[unique=true];attribute
 1234;data-for-attribute
alexnegrila
Discoverer
0 Kudos

Hi Arvind,

I needed to escape colon when adding a sync job to a UserGroup:

UPDATE UserGroup; UID[unique = true];syncJobs(code)
;backofficeadmingroup;"sync glContentCatalog\:Staged->Online"

The impex interpretor was seeing the code as two values split by colon and it was returning this error message:

,,,,incompatible item reference values [sync glContentCatalog, Staged->Online] ( need 1 values, got 2 ) within de.hybris.platform.impex.jalo.translators.ItemExpressionTranslator@5ac9ea0f, incompatible item reference values [sync glContentCatalog, Staged->Online] ( need 1 values, got 2 ) within de.hybris.platform.impex.jalo.translators.ItemExpressionTranslator@2585bf7;;sync glContentCatalog:Staged->Online
alexnegrila
Discoverer
0 Kudos
Hi Arvind