# Arrayformula and importxml

**URL:** <https://community.glideapps.com/t/arrayformula-and-importxml/27077>\
**Category:** Ask for Help\
**Created:** [May 21, 2021, 5:25pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077 "2021-05-21T17:25:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)\
**Post date:** [May 21, 2021, 5:25pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/1 "2021-05-21T17:25:38Z")

</div>

Hello,

I’m working on a crypto portfolio app. Coming soon!

I am using importxml to grab the price of crypto from coinmarketcap. Unfortunately, importxml and arrayformula don’t work together, so when the user adds a coin on the app, the price stays empty on the google sheet, because I can’t use arrayformula. Any solutions? Thank you!

I was able to add the formula as a template on the database but then it won’t let me add it on the “add coin” screen.

@ThinhDinh

 ![Screen Shot 2021-05-21 at 12.29.29 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/5/3540c4651ede562a2419ec3c44a0607d7559c483.png)

 ![Screen Shot 2021-05-21 at 12.27.48 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/b/7b3f94d19822c6f4a2586f8cc01c9d3c00af26e6.png)

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [May 21, 2021, 5:30pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/2 "2021-05-21T17:30:22Z")

</div>

You are putting Google Sheet formulas into Glide table columns. That isn’t how Glide works. You do things in GSheets, and some things you can do in Glide 🙂

---

<div class="post-metadata">

**Author:** ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)\
**Post date:** [May 21, 2021, 5:30pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/3 "2021-05-21T17:30:52Z")

</div>

I tried that as well…nothing worked…open to suggestions! @Mark_Turrell

 ![Screen Shot 2021-05-21 at 12.31.24 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/8/78dedad707a8806c66b45e0d7be31c4a1f441d3e.png)

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [May 21, 2021, 5:34pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/4 "2021-05-21T17:34:15Z")

</div>

In GSheets you can put the arrayformula into the top row already - so that will copy down when a new row appears.

---

<div class="post-metadata">

**Author:** ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)\
**Post date:** [May 21, 2021, 5:36pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/5 "2021-05-21T17:36:44Z")

</div>

Importxml and arrayformula don’t work together…that’s apparently common knowledge but not sure why.

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [May 21, 2021, 5:39pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/6 "2021-05-21T17:39:23Z")

</div>

Then you’ll need some script things. Or better, think creatively about your app. For instance….

You make a list of the top 100…. Fine… 1000 coins  
And have one sheet that just does IMPORTXML

That means you have a sheet with the latest prices, at least.

Then when a user gets a coin, there is a rel between the coin they have…… and…… the live price sheet 🙂

---

<div class="post-metadata">

**Author:** ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)\
**Post date:** [May 21, 2021, 5:53pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/7 "2021-05-21T17:53:17Z")

</div>

That’s good advice that I already tried 🤣 BUT the more these importxml rows, the slower it loads and things start breaking because the price doesn’t fetch properly. That’s why I just added like 20 coins and want to allow the end user to add their own coins.

Thank you @Mark_Turrell

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [May 21, 2021, 6:11pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/8 "2021-05-21T18:11:56Z")

</div>

Ok, in that case you can let the user select a coin, and if they don’t see it, they could ‘add’ a new one. Then, in the Form submit action (or button), you save as normal PLUS you add a row to the GSheets with your importxml formulas. Then a script in GS to put your formula into the new row.

Maybe…. You’ll have to try things out 😉 I fail a lot with my ideas 🙂

---

<div class="post-metadata">

**Author:** ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)\
**Post date:** [May 21, 2021, 6:14pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/9 "2021-05-21T18:14:21Z")

</div>

Thanks! I don’t know any scripting so that could be a problem! I think I exhausted all the “no code” solutions! 🤣 🤣 🤣

---

<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:** [May 21, 2021, 11:44pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/10 "2021-05-21T23:44:10Z")

</div>

As you have found out, IMPORTXML doesn’t work with arrayformulas. Scripting is the only way to do this, if you want to do it then let me know, I will try to help.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [May 22, 2021, 4:19am UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/11 "2021-05-22T04:19:20Z")

</div>

Hola,

The @Mark_Turrell ‘s idea is a good option but I would modify a little:  
1- Create your Top 20 cryptocurrency List in a Sheet and set an ID to each one (coin ID). In another column you have the coin price using IMPORTXML()  
2- When the user chooses a coin, he will choose a coin ID from a list and this value will be written to your GS  
3- Later, use vlookup() with arrayformula() in your GS to find the current coin price associated to coin ID chosen by user.

The problem here is the price update but it is another story meanwhile, It should work with no problem.

Saludos!

---

<div class="post-metadata">

**Author:** ![Keiber\_Molero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/keiber_molero/32/34119_2.png) [@Keiber\_Molero](https://community.glideapps.com/u/Keiber_Molero)\
**Post date:** [November 7, 2021, 3:10pm UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/12 "2021-11-07T15:10:41Z")

</div>

Hi @SuperMerabh, where did you get the IDs of the cryptos?

I am developing an NFT app but I need the id of some crypto

---

<div class="post-metadata">

**Author:** ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)\
**Post date:** [November 23, 2021, 12:50am UTC](https://community.glideapps.com/t/arrayformula-and-importxml/27077/13 "2021-11-23T00:50:01Z")

</div>

it’s the last part of the URL of the coin on [coinmarketcap.com](http://coinmarketcap.com)
