We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

What the difference with /field request and Mapping Object

Answered
Brad Huang asked on December 31, 2020

The request "/field" used for getting the information of fields.
And in the section: https://www.flexmonster.com/doc/supporting-multilevel-hierarchies/
Described that we need to use Mapping Object to describe the hierarchy relationship between fields.

Can I only use request "/field" to describe the hierarchy relationship between fields, and get the info from our server. And no need to send another request by ourself to get the hierarchy relationship. so we can replace  Mapping Object with request "/field".

2 answers

Public
Vera Didenko Vera Didenko Flexmonster January 4, 2021

Hello, Brad Huang,
 
Thank you for your question.
 
Yes, as an alternative to the mapping object, you can define the hierarchy relationship between fields in the /fields response.
Here is an example of a /fields response where the "Category" and "Color" fields are grouped under the "Item" hierarchy (with "Category" as the top level of the hierarchy):

{   
"fields":[
{
"uniqueName":"Category",
"caption":"Category",
"type":"string",
"hierarchy":"Item"
},
{
"uniqueName":"Color",
"caption":"Color",
"type":"string",
"hierarchy":"Item",
"parent":"Category"
},
{
"uniqueName":"Price",
"caption":"Price",
"type":"number"
},
...
],

"aggregations":{
"any":["count","distinctcount"],
"number":[...],
"date":[...]
},

"filters":{
"advanced":true,
string: {
members: true,
query: [...],
valueQuery: [...]
},
...
}
}

 
 
Please let us know if this works.
Looking forward to your feedback.
 
Kind regards,
Vera

Public
Brad Huang January 6, 2021

It works fine with me.
Thanks a lot!

Please login or Register to Submit Answer