Hi Kiran, If you get the error:
Error parsing chart data: JSON.parse is not a function or its return value is not iterable
when using a microflow as the data source for a custom chart in the Charts module, here’s what you need to check and do:
Your microflow must return a single String containing valid JSON not an object or list. Use an Export Mapping to convert your non-persistent objects to a JSON string.
Set the microflow return type to String and ensure it outputs the JSON string generated by the export mapping.
In the chart widget, select the microflow as the data source. The widget will internally call JSON.parse
on the returned string to get the data.
When the user changes the filter (e.g., dropdown), trigger the microflow again to fetch filtered data and update the JSON string, which will refresh the chart.
This approach fixes the parsing error because the chart widget expects a JSON string to parse, not an already parsed object.
Hope this helps :)
Still issues was not solved share me picture for more clarity.