Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 83120

Issue parsing json snippet with ":" in key name

$
0
0
I am setting up a REST call (from alphavantage.co) which returns a JSON object whose key names include the ':' character.  The keys are enclosed in quotes so this is (apparently?) allowed.  Here is an abridged version of the snippet: {"Meta Data": {"Information": "US Sector Performance (realtime & historical)","Last Refreshed": "04:20 PM ET 11/17/2017" },"Rank A: Real-Time Performance": {"Telecommunication Services": "0.65%","Consumer Discretionary": "0.48%","Energy": "0.43%","Materials": "0.11%","Financials": "-0.13%","Health Care": "-0.39%","Consumer Staples": "-0.41%","Industrials": "-0.48%","Real Estate": "-0.56%","Information Technology": "-0.67%","Utilities": "-0.74%" },"Rank B: 1 Day Performance": {"Telecommunication Services": "0.64%","Consumer Discretionary": "0.48%","Energy": "0.43%","Materials": "0.11%","Financials": "-0.13%","Health Care": "-0.39%","Consumer Staples": "-0.41%","Industrials": "-0.48%","Real Estate": "-0.56%","Information Technology": "-0.67%","Utilities": "-0.74%" } }   When I create a JSON snippet in Mendix (v7.5.1), the "prefix" to the keys containing quotes is removed.  For example: "Rank B: 1 Day Performance" becomes " 1 Day Performance" (including the leading space). The call correctly returns the root and meta-data objects but the other objects (Rank A, Rank B, etc.) are not returned.  I assume this is because the key names do not match? Is this a bug or an issue with JSON from provider? Any work around within Mendix?  For example, is it possible to call a Microflow to rename the returned keys so that they match the JSON snippet?  Is it possible to set up the import mapping "manually" (without a JSON snippet)? Thanks!  

Viewing all articles
Browse latest Browse all 83120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>