Neues Thema starten

Address from API to Plentymarkets.

Hello,


We do have a small problem when we transfer address from API to Plentymarkets.


For most platforms the format of the address is street name plus house number in one line, exemple:


2 RUE DU COMMERCE, or, Via San Marco 29. Sometime there is no numbers and the numbers can be at the beginning or st the end.


But in Plentymarkets there is a line for Straße and a line for Nummer.

Is it possible to move the numbers (if there is any) from billingCustomerStreet and add to billingCustomerHouseNumber in database in Synesty?


Thanks for you help


Nicolas


You can try to use a regular expression using the Freemarker matches function which extracts the first number if there is any.


Example:  Foo bar 2 RUE DU COMMERCE


<#assign firstNumber = street!?matches("(\\d+)")>
<#if (firstNumber?? && firstNumber?size > 0)>${firstNumber[0]}</#if>


Output: 2


See the example in action.

Thank you very mush for your help. 


Now I just need to find a way to delete the numbers from the first row.

you could add another helper column and use search/replace with your extracted number. 

Very good idea.


Thanks a lot.

Anmelden um einen Kommentar zu veröffentlichen