Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple queries same cell #18

Open
suporteskills opened this issue Oct 15, 2020 · 3 comments
Open

Multiple queries same cell #18

suporteskills opened this issue Oct 15, 2020 · 3 comments

Comments

@suporteskills
Copy link

Hi,

Is there any way to import multiple queries?
That is, to add several IMPORTJSONAPI functions in the same cell and with different filters?

I need to return the following URLs:

https://api.xxxxx.com.br/v1/xxxx/Catalogo/18?&j= "
https://api.xxxxx.com.br/v1/xxxx/Catalogo/20?&j= "
https://api.xxxxx.com.br/v1/xxxx/Catalogo/25?&j= "

As you can see the code after the "/" is changed for each query, so I need to aggregate all of these queries in a single cell.

@qeet
Copy link
Owner

qeet commented Oct 15, 2020

No way to do this at the moment I'm afraid.

@suporteskills
Copy link
Author

For those who need it I managed to do it using the QUERY formula from Google Sheets.

Problem solved, thanks.

Here is an example:

=QUERY({IMPORTJSONAPI("https://api.xxxx.com.br/v1/CrossDocking/Catalogo/2?limit=4000&j="; "$.produtos[?(@.preco_normal>20)]";((CAMPOS_IMPORTJSONAPI));"headers={'token':'da363bf44XXXXXXXXXXdebdbe4788d2'}");IMPORTJSONAPI("https://api.xxxx.com.br/v1/CrossDocking/Catalogo/3?limit=4000&j=";"$.produtos[?(@.preco_normal>20)]";((CAMPOS_IMPORTJSONAPI));"headers={'token':'da363bf4445cXXXXXXXXXbdbe4788d2'}");IMPORTJSONAPI("https://api.xxxx.com.br/v1/CrossDocking/Catalogo/4?limit=4000&j=";"$.produtos[?(@.preco_normal>20)]";((CAMPOS_IMPORTJSONAPI));"headers={'token':'da363bf4445cdXXXXXXXXXXXXdbe4788d2'}");IMPORTJSONAPI("https://api.xxxx.com.br/v1/CrossDocking/Catalogo/14?limit=4000&j=";"$.produtos[?(@.preco_normal>20)]";((CAMPOS_IMPORTJSONAPI));"headers={'token':'da363bf4445cd95d4XXXXXXXXXXXXe4788d2'}");IMPORTJSONAPI("https://api.xxxx.com.br/v1/CrossDocking/Catalogo/18?limit=4000&j=";"$.produtos[?(@.preco_normal>20)]";((CAMPOS_IMPORTJSONAPI));"headers={'token':'da363bf4445cdXXXXXXXXXXXXXXXXX788d2'}");IMPORTJSONAPI("https://api.xxxx.com.br/v1/CrossDocking/Catalogo/23?limit=4000&j=";"$.produtos[?(@.preco_normal>20)]";((CAMPOS_IMPORTJSONAPI));"headers={'token':'da363bf4445cdXXXXXXXXXXXXXXbe4788d2'}");IMPORTJSONAPI("https://api.xxxx.com.br/v1/CrossDocking/Catalogo/19?limit=4000&j=";"$.produtos[?(@.preco_normal>20)]";((CAMPOS_IMPORTJSONAPI));"headers={'token':'da363bf4445cXXXXXXXXXXXdbe4788d2'}")};"SELECT * ")

@qeet
Copy link
Owner

qeet commented Oct 16, 2020

Well done and thanks for sharing the solution!

I will reopen this issue just so that it is easier for other people to find this info.

@qeet qeet reopened this Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants