Notification

Please be advised that the Customer Support team does not provide troubleshooting services in your current display language. To contact Support team staff, please first switch to English or other supported languages (Spanish, Portuguese or Japanese). 

search

Returns the starting position of the first instance of needle in haystack

Always counts in the natural direction of the advertiser’s locale. For example, if the advertiser's language is English, this function counts from left to right.

Syntax

search(needle, haystack)

Parameters

haystack and needle can be any of the following:

  • Static text, such as 'GDN'.
  • A Search Ads 360 variable that is a string, such as a Keyword, Campaign and so on.
  • An expression or formula column that returns a string.

Case insensitive

Text searches are case insensitive.

Empty character

If you include an expression or formula column in this function, the expression or formula column could evaluate to an empty text string.

Make sure that you're aware that searching for an empty string always returns 1. That is, search("", "GDN") evaluates to 1.

Examples

  • [search("cow","cowabunga")] returns 1.
  • [search("abunga","cowabunga")] returns 4.
  • [search("a","cowabunga")] returns 4, which is the location of the first a.

Related links

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Main menu
8621230739322678568
true
Search Help Centre
true
true
true
true
true
5055977
false
false