☝️Small business or a startup? See if you qualify for our special offer.
+

Overwirte a column to null

Answered
jhshin asked 4 days ago

We are developing a custom api.
When grouped based on a row, the calculated values for 'a' and 'null' come in response.
However, Flex Monster overwrites 'a' to the value of 'null'.
Therefore, the expand operation performed when 'a' is pressed sets the 

filter.member.include part to 'null', not 'a'
I want both 'a' and 'null' to be rendered on the screen.

 

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster 3 days ago

Hello,

Thank you for reaching out to us.

As for the issue with setting the value of "null" to the "a" value, this is caused by null IDs defined in the /members response. We have described this matter in more detail in your previous ticket: https://www.flexmonster.com/question/the-pivot-table-does-not-show-all-field-values/#answer-74724

To show empty members on the grid, we suggest following these steps:

  • Return a member with the null value:
"members": [{
  "value": "green"
},{
"value": "blue"
},{
"value": null
}]
  • In the /select response, return the "keys" object with member value set to an empty string:
"values": {
"Price": {
"sum": 679804
}
},
"keys": {
"Color": ""
}

We are looking forward to hearing your feedback.

Best Regards,
Maksym

Public
jhshin 2 days ago

Thank you. now I can see 'null' key as (blank) in grid.

but I got additional problem. 

I want to group **Name as 'null', but request body sends filter.include.member as "".

To get right result, I think filter.include.member should be set null.

Is there any options to change "" to null in filter.include.member ?

Public
Maksym Diachenko Maksym Diachenko Flexmonster 2 days ago

Hello,

Thank you for reaching out to us.

Please note that, by default, Flexmonster is grouping all possible empty values as a single "(blank)" member, which includes null, undefined, and empty string. With this setup, the component requires the empty member to be specified as an empty string in the /select response. This is required for the unification logic.

With the distinguishNullUndefinedEmpty option, Flexmonster will consider null, undefined, and an empty string to be different members. With this option specified, you should return the original member value like null in both /select and /members requests. However, it would disable the grouping of different variants of empty members, as is shown in this example: https://jsfiddle.net/flexmonster/czf507my/

Please let us know if our recommendation helped you.

Best Regards,
Maksym

Please login or Register to Submit Answer