Need a special offer?Find out if your project fits.
+

Filter From JSON Array

Answered
Scott Oliver asked on June 1, 2021

Just out of curiosity, is it possible within flex to filter from a JSON array? For example, in the below JSON, if a filter was applied for "football" as the hobby, two users would appear.
 

{
"username":"example"
,"hobbies":
[
"football"
,"basketball"
,"painting"
]
,"occupation":"unknown"
}
,{
"username":"second example"
,"hobbies":
[
"football"
]
,"occupation":"unknown"
}
,{
"username":"third example"
,"hobbies":
[
"tennis"
,"basketball"
]
,"occupation":"unknown"
}

3 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 1, 2021

Hello, Scott,
 
Thank you for reaching out to us.
 
Please note that Flexmosnter does not support nested structures. You will need to flatten the dataset for this purpose. For example, the mentioned record

{
    "username": "third example",
    "hobbies": [
        "tennis",
        "basketball"
    ],
    "occupation": "unknown"
}

needs to be split into the following:

{
    "username": "third example",
    "hobbies": "basketball",
    "occupation": "unknown"
},
{
    "username": "third example",
    "hobbies": "tennis",
    "occupation": "unknown"
}

 
In this case, you will be able to filter by any field present in the dataset.
 
Please let us know if it helps.
 
Kind regards,
Illia

Public
Scott Oliver June 1, 2021

Hello,
 
Unfortunately this doesn't help due to the size and scale of our data, particularly when we begin to add financial and numerical information which is summarised.
 
Are there any alternatives that you see?

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 3, 2021

Hello, Scott,
 
Thank you for your feedback.
 
Currently, there are no other approaches to import nested data in Flexmonster. You can see all the available data sources and corresponding formats in our documentation: Supported data sources.
 
Please let us know if any other questions arise.
 
Best regards,
Illia

Please login or Register to Submit Answer