❄️✨Ho-ho-holiday offer for new projects! Check out our pricing page.

Restrict the Values ("measures") box on the Fields modal to two specific values

Answered
Rafael asked on December 12, 2025

Hello, I've read:
- https://www.flexmonster.com/question/restrict-selection-in-field-editor/
- https://www.flexmonster.com/question/calculated-values-can-be-dragged-in-fields-popup/
- https://www.flexmonster.com/question/how-to-disabled-fields-columns-value/

And I've seen the solution with strictDataTypes, but that not solves the issue for me.

I would like to restrict only 2 specific fields to be able to be dragged and "checkboxed" into the Values/Measures box, without needing to create a custom Fields List.

Right now I can restrict anything that's not a measure, but I have more than 2 measures as Fields in the report.

If thats not possible, I would like to be able to, in the Fields Modal, disable the Values/measures box, so I can use a solution like this to toggle between the two specific values: https://jsfiddle.net/flexmonster/8d5on276/

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster December 15, 2025

Hello,

Thank you for contacting us.

There are two possible solutions for limiting measure selection in the Field List that might fit your requirements.

Firstly, you can use the strictDataTypes option with mapping to define a set of measures that can be added to values: https://jsfiddle.net/flexmonster/g91rbdpv/. The type of other measures can be defined as "string" to prevent them from being added to values, while still allowing them to be used in columns and rows. We understand that you have already reviewed this approach and that it does not resolve the issue on your end. Could you please clarify what exactly does not work for you with strictDataTypes in this case, or which requirement it fails to cover?

Secondly, the measures that should be restricted from adding can be hidden entirely from the Field List by setting the visible property to false in the mapping: https://jsfiddle.net/flexmonster/rb1g2Lmv/

If neither of the above approaches fits your use case, it is possible to remove the measures from the Field List entirely and control the active measure programmatically, with a toggle button: https://jsfiddle.net/flexmonster/8d5on276/

We are looking forward to hearing your feedback.

Best regards,
Maksym

Public
Rafael December 16, 2025

Hello Maksym.

This will be very hacky, and it is a medium priority around here, so we are postponing the implementation.

What we would probably do is intercept the mapping before rendering the pivot table, but after loading the data from the API, iterating in all fields in the mapping` to add "type": "string", except for the two fields we want to be able to use as Measures in Values. All of this in a specific report of all that we show to users.

All of this in conjunction to setting strictDataTypes for that report.

That would probably solve the issue.

Thank you very much for your reply.

Public
Maksym Diachenko Maksym Diachenko Flexmonster December 18, 2025

Hello, Rafael,

Thank you for your reply.

We are glad to hear that the approach with strictDataTypes is suitable for you. At the same time, regarding the idea of intercepting or modifying the mapping after the data is loaded, it is important to note that the mapping defines field types for the entire component and directly affects the internal data structure. Because of this, the mapping can only be applied via the report configuration and cannot be changed at runtime without reloading the report.

For that reason, we recommend predefining the mapping in the data source, as shown in this example: https://jsfiddle.net/flexmonster/g91rbdpv/

If you have any further questions, feel free to contact us.

Best regards,
Maksym

Please sign in or register to submit your answer