How about value ? (value.replace(/\D/g, '') + 'KGM') : null, it will strip all non numeric characters. That way users can only enter numbers and KGM will always be added to the end.
Change the regexp when needed, for example if you want to allow number and the dot /[^0-9\.]/g.
The expression is triggered/executed each time some data/state on the page is updated/changed.
So the first time, user enters 10 in the input. '10' + 'KGM' = '10KGM' the input value becomes now 10KGM. Now something else on the triggers/executes the expression again, value is now '10KGM' + 'KGM' = '10KGMKGM'. So it adds an othe KGM to the previous value, this continues each time that the expression is triggered/executed.
Hello Patrick,
Please advice on how i can replace value field (array resulting from query e.g id is (1,2,3,…) with the corresponding text value such as category (football, basketball, volleyball)
The map formatter is not implemented in the UI, but it is available in the code. If it was a string you could first do a split and you can also do a join at the end to format it with a new separator.
Data can come from a database, a json file, a value component or added using code.
You can also do a simple replace if there are not many categories like: