Skip to content

Instantly share code, notes, and snippets.

@lhem
Last active December 15, 2022 22:46
Show Gist options
  • Save lhem/779d609a07b85f830c696971acadd3c8 to your computer and use it in GitHub Desktop.
Save lhem/779d609a07b85f830c696971acadd3c8 to your computer and use it in GitHub Desktop.
//Ex 1: https://exceljet.net/functions/webservice-function
Eval=LAMBDA(x,EVALUATE(x));
xml=Eval("WEBSERVICE(""https://www.nasa.gov/rss/dyn/breaking_news.rss"")");
//Ex 2: https://www.w3resource.com/JSON/introduction.php
Book=LAMBDA(index1,[index2],[index3],
SWITCH(index1,
"Title", "The Cuckoo's Calling",
"Author", "Robert Galbraith",
"Genre", "classic crime novel",
"Detail",
SWITCH(index2,
"Publisher", "Little Brown",
"Publication_Year", 2013,
"ISBN-13", 9781408704004,
"Language", "English",
"Pages", 494,
),
"Price",
CHOOSE(index2,
SWITCH(index3,
"type", "Hardcover",
"price", 16.65,
),
SWITCH(index3,
"type", "Kidle Edition",
"price", 7.03,
)
)
)
);
Price=MAP({1,1;2,2},
{"type","price";"type","price"},
LAMBDA(index2,index3,
DataTypes.Book("Price",index2,index3)
)
)
// JSON
// {
// "Title": "The Cuckoo's Calling",
// "Author": "Robert Galbraith",
// "Genre": "classic crime novel",
// "Detail": {
// "Publisher": "Little Brown",
// "Publication_Year": 2013,
// "ISBN-13": 9781408704004,
// "Language": "English",
// "Pages": 494
// },
// "Price": [
// {
// "type": "Hardcover",
// "price": 16.65
// },
// {
// "type": "Kindle Edition",
// "price": 7.03
// }
// ]
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment