Follow

List of Dynamic Functions

Dynamic Functions

Dynamic Functions

Dynamic functions provide an increased flexibility for ads/keyword creation and feed data manipulation. All dynamic functions have to be written with tags, between <> signs, for example: <strLeft([c1],4)>.

The dynamic function can be used either in the Ads or Keywords actions.

String Functions SKU Functions URLFunctions Execute Functions Numeric Functions

strCase

skuAddDashes urlParam fnDistinct numTiers

strClear

skuCutLeft urlParamEncrypt fnRequired numAdd

strCut

skuCutRight   fnTextToRow numMultiple

strDate

skuExtract     numDecimal

strFit

skuRemoveSigns     numRound

strFitToAd

skuRemoveWnD      bidByMatch 

strFitR

skuRemoveWnD_only      

strIFTTT

       

strIIF

       

strLeft

       

strMid

       

strNull

       

strPhrase

       

strPrefix

       

strRemoveDKI

       

strRemoveEnclosed

       

strReplace

       

strRgxReplace

       

strReverse

       

strRight

       

strRows

       

strStuff

       

strSuffix

       

strURL

       

strWord

       

strWord2

       
strReverseWords        
strTiersLen        

 

String Functions

strCase (string, case)

Return the string by the case format:

Case 1: KEY WORD
Case 2: Key Word
Case 3: Key Word (Products)
Case 4: Key word
Case 5: key word

Example:

Function
Result

<strCase([title],1)>

[title] = I Love New York

I LOVE NEW YORK

<strCase([title],5)>

[title] = I Love New York

i love new york

 

Back To Top

strClear - (string, sign, clear_before_sign, leave_sign)

Clean all data after/before sign. The sign doesn’t have to be removed:
0 = after sign; 1 = before sign
0 = remove sign; 1 = leave sign

Example:

Function
Result
<strClear(EX2001-BBB,-,0,1)> EX2001-
<strClear(EX2001-BBB,-,1,1)> -BBB
<strClear(EX2001-BBB,-,0,0)> EX2001
<strClear(EX2001-BBB,-,1,0)> BBB

 

Back To Top

strCut - (string, cut_len, cut_side)

Cut characters from a string according to the cut_len and cut_side (left/right)

Example:

Function
Result

<strCut([Sku],1,Right)>

[Sku] = EX2001Z23

EX2001Z2

<strCut([Sku],2,Left)>

[Sku] = EX2001Z23

2001Z23

 

Back To Top

StrDate - (date, date_format, new_format)

Arrange dates by different formats.

Example:

Function
Result
<strDate([c3], yyyy/mm/dd, mm.dd)>  mm.dd
<strDate(2010/05/22, yyyy/mm/dd, yy/mm)> 10/05

 

Back To Top

strFit (string, length)

Cut the string by words in order to fit the character length parameter.

Example:

Function
Result
<strFit(I Love New York,8)> I Love
<strFit(I Love New York,25)> I Love New York

 

Back To Top

strFitToAd (string, Row1_length, Row2_Length, Row3_Length)

Take the string and cut it by number of characters. When you set row1_length to 25, then row two and three to zero, you indicate that the function should return the string, up until the first 25 characters (removing words that do not fit into that character length). 

When you set row1_length to 25, and then row2_length to 35 (row3 is zero), the function will remove the first 25 characters (not including partial words) and then will count 35 characters from what is left. 

Row1, Row2 and Row3 can be equivalent to Headline, Description line1, and Description line2

The lengths of Row2, and Row3 can be zero. 

Example:

FunctionResult
<strFitToAd(I have a great product! Try it today.,25,0,0)> I have a great product!
<strFitToAd(I have a great product! Try it today.,25,35,0)>

Try it today.

<strFitToAd(aaa bbb ccc ddd eee,5,9,6)>

ddd

 

Back To Top

strFitR (string, length)

Cut the string by words in order to fit the character length parameter from right to left

Example:

Function
Result
<strFitR(I Love New York,8)> New York
<strFitR(I Love New York,25)> I Love New York

 

Back To Top 

strLeft (string, length)

Returns the left part of a character string with the specified number of characters.

Example:

Function
Result
<strLeft(XT5500DE,6)> XT5500
<strLeft(XT5500DE,2)> XT

*Note – This string may cut a word depending on the character's count. If the action is word sensitive please use strFit

 

Back To Top

strMid (string, start, length)

Returns the middle part of a character string with the specified start and length arguments.

Example:

Function
Result
<strMid(XT5500DE,3,4)>  5500
<strMid(XT5500DE,6,2)> DE

 

Back To Top

strNull (string, replace)

A null or empty string can be replaced with text.

Example:

Function
Result
Case
<strNull([c1],top brands)> [c1] [c1] is name of brand
<strNull([c1],top brands)> Top Brands [c1] is null or empty

 

Back To Top

strPhrase (field1, field2, field3, field4, field5)

Create a keyword, or phrase from multiple fields in your feed, but returns null if one of the arguments is null.

(All fields are mandatory for the phrase to be created)

Note: Use the * symbol to fill in fields not in use.

FunctionResult

<strPhrase([brand],[category], ,*,*)> 

[brand] = Rolex; [category] = Watch

null

<strPhrase([brand],[category],[sku],*,*)>

[brand] = Rolex; [category] = Watch; [sku] = 123456

Rolex Watch 123456

 

Back To Top

strPrefix (string, ignore_list, prefix)

Add a prefix to selected data. Define an ignore list.

Example:

Function
Result
<strPrefix(learn photoshop,learn|course,learn )> learn photoshop
<strPrefix(photoshop,learn|course,learn )> learn photoshop

 *Note – The ignore_list is delimited by the pipe " |" character

 

Back To Top

strRemoveDKI(string)

Remove dynamic keywords from the string. The default phrase remains.

Example:

Function
Result
<strRemoveDKI(Sony {KeyWord:Vaio})> Sony Vaio

 

Back To Top

strRemoveEnclosed(string)

Removes text surrounded by parenthesis from the original string including the parenthesis

Example:

Function
Result
<strRemoveEnclosed(EX2001 (B100))>  EX2001
<strRemoveEnclosed(EX2001)> EX2001

 

Back To Top

strReplace (string, find, find_type, replace)

A sub string can be replaced within a string. This “sub string” can be a whole criterion.

(1=all phrase, 2=any word, 3=any sub-string)

Example:

Function
Result
<strReplace(Love LA,LA,2,NY)>  Love NY
<strReplace([c1],[c2],3,)> [c1] excluding [c2]

 

Back To Top 

strRgxReplace (string, regex pattern, replacement)

A classic regex replacement function. Any standard and valid regex and regex replacement will work

Example:

Function
Result

having [field] = some text

<strRgxReplace([field],^some,any)> 

any text 

having [field] = www.site.com#Packages/p1

<strRgxReplace([field],(^.+?#Packages/).*,$1)>

www.site.com#Packages/

 

Back To Top

strReverse (string)

Returns the character string in reverse order.

Example:

Function
Result
<strReverse(XT5500DE)> ED0055TX 
<strReverse(T200)> 002T

 

Back To Top

strRight (string, length)

Returns the right part of a character string with the specified number of characters.

Example:

Function
Result
<strRight(XT5500DE,6)> 5500DE
<strRight(XT5500DE,2)> DE

 

*Note – This string may cut a word depending on the character's count. If the action is word sensitive please use strFit

 

Back To Top

strRows(string, length)

For image ads, a single string can be broken down into rows according to the length parameter.

Example:

Function
Result
<strRows(I Love New York,8)> 

I Love

New York

 

Back To Top

strStuff (string, start, length, replace_string)

Replaces part of a text string with a newly defined text string.

Example:

Function
Result
<strStuff(XT5500DE,6,2,XX)> XT5500XX
<strStuff(T200,1,1,E)> E200

 

Back To Top

strSuffix (string, ignore_list, suffix)

Add a suffix to selected data. Define an ignore list.

Example:

Function
Result
<strSuffix(the doors,s|es,s)>  the doors 
<strSuffix(courses,s|es,s)> courses
<strSuffix(the door,s|es,s)> the doors

*Note – The ignore_list is delimited by the pipe " |" character.

 

Back To Top 

strWord (string, divider, index)

Extracts from the phrase the desired word according to its position. If there is no word at the indicated index this function will return the first/last cell.

Example:

Function
Result
<strWord(Sony Vaio XB220, ,1)>  Sony
<strWord(Sony Vaio XB220, ,3)> XB220
<strWord(Sony Vaio XB220, ,6)> XB220

 

Back To Top 

strWord2 (string, divider, index)

Extracts from the phrase the desired word according to its position. If there is no word at the indicated index this function will return an empty value (null).

Example:

FunctionResult
<strWord2(Sony Vaio XB220, ,1)>  Sony
<strWord2(Sony Vaio XB220, ,3)> XB220

<strWord2(Sony Vaio XB220, ,6)>

 

Back To Top

strURL (url, type)

Return decode/encode url by the type case .

Example:

Function
Result
<strUrl(http://mysite.com,encode)>  http%3A%2F%2Fmysite.com
<strUrl(http%3A%2F%2Fmysite.com,decode)> http://mysite.com

 

Back To Top

strIFTTT (if part1, operator, if part2, then, else)

An “If This Then That” generic function for both strings and numbers

Optional numeric operators are:

=, >=, <=

Optional string operators are:

contains, does not contains, is, starts with, ends with, matches any

Example:

Function
Result

<strIFTTT([price],\>=,10,10% Discount,5% Discount)>

[price]=11 

10% Discount

<strIFTTT([brand],is,Sony,10% Discount,5% Discount)>

[brand]=Microsoft 

5% Discount

<strIFTTT([brand],matches any,Sony;Microsoft;Apple,10% Discount,5% Discount)>

[brand]=Microsoft 

10% Discount

 

Back To Top

strIIF (string, value, if result, else result)

Display "Out of Stock" or "In Stock" when appropriate

Example:

Function
Result

<strIIF([stock],0,Out of stock,In stock)>

[stock]=0 

Out of stock 

<strIIF([stock],0,Out of stock,In stock)>

[stock]=5

In stock

 

Back To Top

strReverseWords (string)

Reverse word order.

Example:

Function
Result
< strReverseWords(I Love NY)> NY Love I 

 

Back To Top

strTiersLen (tiers, param)

Get the tier value according to the characters length value of the parameter.

tiers are separated by x1=y1;x2=y2;x3=y3

X = tier max value

Y = tier value

Example:

Function
Result

<strTiersLen(10=short headline;35=long headline,[brand])>

[brand] = sony 
short headline 

<strTiersLen(10=short headline;35=long headline,[brand])>

[brand] = sony electronics
long headline

 

Back To Top

SKU Functions

skuAddDashes (string)

Returns the original string (sku) with dashes between numbers and alphabetic characters.

Example:

Function
Result
<skuAddDashes(XT5500DE)> XT-5500-DE
<skuAddDashes(T200)> T-200

 

Back To Top

skuCutLeft (string)

Remove the left “part” (part = group of numbers or alphabetic characters) from the original string (sku).

Example:

Function
Result
<skuCutLeft(XT5500DE)> 5500DE
<skuCutLeft(T-200)> 200

 

Back To Top

skuCutRight (string)

Remove the right “part” (part = group of numbers or alphabetic characters) from the original string (sku).

Example:

Function
Result
<skuCutRight(XT5500DE)> XT5500
<skuCutRight(T-200)> T

 

Back To Top

skuExtract (string, trim)

Returns the first entry of an “sku format” word (a word contain both numbers and alphabetic characters), if none return an empty string.

Example:

Function
Result
<skuExtract(Buy XT5500DE,all)>  XT5500DE
< skuExtract(Buy,all)>  

 

Back To Top

skuRemoveSigns (string)

Returns the original string (sku) without signs.

Example:

Function
Result
<skuRemoveSigns(XT-5500-DE)> XT5500DE
< skuRemoveSigns(100.99.84)> 1009984

 

Back To Top

skuRemoveWnD (string)

Cuts weights, dimensions and colors from a string.

Function
Result
<skuRemoveWnD(T200 6GB)> T200
<skuRemoveWnD(T200 Black)> T200

 

Back To Top

skuRemoveWnD_only (string)

Cuts ONLY weights and dimensions, does not remove colors.

Function
Result
<skuRemoveWnD_only(jimi hendrix 30gb)>  jimi hendrix 
<skuRemoveWnD_only(jimi hendrix red)> jimi hendrix red

 

Back To Top

URL Functions

urlParam (url, param, value)

Return the url with the new/altered param

Function
Result
 <urlParam(mysite.com,productId,99)>  mysite.com?productId=99
 <urlParam(mysite.com?productId=99, productId,100)>  mysite.com?productId=100
 <urlParam(mysite.com?productId=99, categoryId,12)>  mysite.com?productId=99&categoryId=12

 

Back To Top

 

urlParamEncrypt (url, param, value)

Return the url with the new/altered param

FunctionResult
 <urlParamEncrypt(mysite.com,productId,99)>  mysite.com?productId=Bxj2w%3D%3D
 <urlParamEncrypt(mysite.com?productId=99, productId,100)>  mysite.com?productId=Bxj2w%3D%3DZX
 <urlParamEncrypt(mysite.com?productId=99, categoryId,12)>  mysite.com?productId=Bxj2w%3D%3D&categoryId=cxBxj2w%3D%3D

 

 

Execute Functions

fnDistinct()

Delete rows with duplicate values of a specific field (make it distinct).

Function
<fnDistinct()>

 

Back To Top

fnRequired()

Delete null/empty rows of a specific field.

Function
<fnRequired()>

 

Back To Top

fnTextToRow(Delimiter)

This function will expand a field from your feed into multiple rows, as long as there is a delimiter.

Split a field (de-normalize text to rows) by divider/delimiter.

Example: You have a field that contains the following: Sony*Apple*Microsoft

The result will be each word in a new row. 

Function
Result
<fnTextToRow(*)>

Sony

 

Apple

 

Microsoft

 

Numeric Functions

 

numTiers(tier max value:tier value,param, tier type)

Calculate the tier value according to the value of the parameter.

tiers are separated by x1:y1;x2:y2;x3:y3

X = tier max value

Y = tier value

type can be:

Tiers = return the tier value of a single tier

Accumulated = multi tiers calculation

Example:

Function
Result

<numTiers(100:0.15;500:0.25;10000;0.50,[price],Tiers)>

[price] = 325

0.25

<numTiers(100:0.15;500:0.25;10000;0.50,[price],Accumulated)>

[price] = 325

0.21923

 

Back To Top

numAdd(number,additive,min,max)

Add a value to a specific numeric field.

Example:

Function
Result

<numAdd([price],20,1,800)> 

[price] = 100

Result: [price] = 120

 

Back To Top

numMultiple(number, multiple, min, max)

Multiply a numeric field or value by a numeric factor.

Example:

Function
Result

<numMultiple([price],1.5,1,800)> 

[price] = 100

Result: [price] = 150

 

Back To Top

numDecimal(number, decimal)

Add/Remove decimal places from a number.

Example:

Function
Result

<numDecimal(12.99,1)> 

12.9 

<numDecimal(12.99,0)>

12

 

Back To Top

numRound(number, round_type, decimal)

Round by the round_type (up/down/normal) and show number of decimal places.

Example:

Function
Result

<numRound(12.99,down,1)> 

12.8

<numRound(12.99,normal,1)>

13
<numRound(12.99,down,0)> 12

 

Back To Top

bidByMatch(exact,phrase,modified,broad)

Set bids for each keyword match type. 

Example:

FunctionResult

<bidByMatch(4,3,2,1)> 

Keyword match type = phrase

bid = 3

<bidByMatch(4,3,2,1)> 

Keyword match type = modified broad

bid = 2

<bidByMatch(4,3,2,1)> 

Keyword match type = broad

bid = 1

 

Back To Top

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk