# SOLVED - Need help for a ARRAYFORMULA / MAP Query with transpose - auto grabbing google images

**URL:** <https://community.glideapps.com/t/solved-need-help-for-a-arrayformula-map-query-with-transpose-auto-grabbing-google-images/70668>\
**Category:** Ask for Help\
**Created:** [February 9, 2024, 5:31pm UTC](https://community.glideapps.com/t/solved-need-help-for-a-arrayformula-map-query-with-transpose-auto-grabbing-google-images/70668 "2024-02-09T17:31:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yod](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yod/32/64472_2.png) [@Yod](https://community.glideapps.com/u/Yod)\
**Post date:** [February 9, 2024, 5:31pm UTC](https://community.glideapps.com/t/solved-need-help-for-a-arrayformula-map-query-with-transpose-auto-grabbing-google-images/70668/1 "2024-02-09T17:31:58Z")

</div>

Hello,

I’ve seen a few subjects on the forum on how to search a Google Image and put the link in a google sheet (in order to display it as an image in Glide).

I found this query :  
=TRANSPOSE(INDEX(QUERY(IMPORTXML(“[https://www.google.com/search?q=“&B33&”&source=lnms&tbm=isch](https://www.google.com/search?q=%22&B33&%22&source=lnms&tbm=isch)”; “//a//@src”);“where Col1 contains ‘image’ limit 2”)))

Where the “B33” is the element I want to search for on Google Images (can’t use Pexels because it’s mostly names of well known people).

My problem is to make it work in an arrayformula ; and from what I found it’s not possible, but it might with MAP.  
I’ve come to this : =MAP(B:B;LAMBDA(n;{n\TRANSPOSE(QUERY(IMPORTXML(“[https://www.google.com/search?q=“&B:B&”&source=lnms&tbm=isch](https://www.google.com/search?q=%22&B:B&%22&source=lnms&tbm=isch)”; “//a//@src”);“where Col1 contains ‘image’ limit 2”))}))

It does auto-fill the whole column, but it does it only for the first value of my B column, doesn’t compute all the lines.

Hope I’m clear and this can also be usefull for other people,

Thanks a lot !

**SOLVED :** I definitely wasn’t far : “just” needed to understand the Lambda function and give it another night.  
To anyone wanting to use this, the right way to do is to change B:B in the query / importXML function to give it the first parameter given by MAP, which will be B1:B (or B:B) ‘inside’ of ‘n’. Just use this and you’ll be good :

=MAP(B:B;LAMBDA(n;{n\TRANSPOSE(QUERY(IMPORTXML(“[https://www.google.com/search?q=“&n&”&source=lnms&tbm=isch](https://www.google.com/search?q=%22&n&%22&source=lnms&tbm=isch)”; “//a//@src”);“where Col1 contains ‘image’ limit 2”))}))

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [February 10, 2024, 2:59pm UTC](https://community.glideapps.com/t/solved-need-help-for-a-arrayformula-map-query-with-transpose-auto-grabbing-google-images/70668/2 "2024-02-10T14:59:01Z")

</div>

If you don’t have a huge amount of items, Serp API might be what you need.

> **[Google Images Results API - SerpApi](https://serpapi.com/images-results)**
>
> Scrape hundreds of images and links from Google Images automatically in JSON format with SerpApi. Use keywords and filters to make precise searches.

---

<div class="post-metadata">

**Author:** ![Yod](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yod/32/64472_2.png) [@Yod](https://community.glideapps.com/u/Yod)\
**Post date:** [February 10, 2024, 5:25pm UTC](https://community.glideapps.com/t/solved-need-help-for-a-arrayformula-map-query-with-transpose-auto-grabbing-google-images/70668/3 "2024-02-10T17:25:43Z")

</div>

Beautiful stuff !  
I needed a solution without API thought, and to auto-complete columns.

Anyway, as I wrote : I solved it 🙂

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [February 10, 2024, 11:36pm UTC](https://community.glideapps.com/t/solved-need-help-for-a-arrayformula-map-query-with-transpose-auto-grabbing-google-images/70668/4 "2024-02-10T23:36:17Z")

</div>

Is there a reason you don’t use Serp with Glide Tables in exchange for Google Sheets?

---

<div class="post-metadata">

**Author:** ![Yod](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yod/32/64472_2.png) [@Yod](https://community.glideapps.com/u/Yod)\
**Post date:** [February 12, 2024, 10:33am UTC](https://community.glideapps.com/t/solved-need-help-for-a-arrayformula-map-query-with-transpose-auto-grabbing-google-images/70668/5 "2024-02-12T10:33:00Z")

</div>

My clients need the Google Sheets for modifying some stuff in it and making saves in Sheets, it’s one of their reasons for choosing Glide 🙂
