I want the Slice Definition to get bind from Object given by API. I don’t want to hardcode the slice definition for each report. Instead I want to store in DB table and call from an API service and bind dyanamically for each report. But FM not taking the slice from object given. It is taking the default slice instead.
Thank you for writing to us.
It seems the reason why the default slice is being applied instead is that the API fetching the slice object is asynchronous.
If the slice object is undefined, then Flexmoster applies the default slice (https://jsfiddle.net/flexmonster/3u4d0ks6/).
For your case, we kindly suggest ensuring that the slice object returned by the API is defined and loaded before it is referred to in Flexmonster.
Please let us know if this helps.
You are welcome to contact us in case any questions arise.
I am able to get the data from API. I am able to see the slice data. Please see the attached screenshot for reference.
But Still it is taking the default slice only, not sure why?
Could you please help me if am doing anything wrong here.
Thank you for your reply.
It seems that a JSON string is passed instead of a JSON object to the slice property.
In such case, the default slice will be applied: https://jsfiddle.net/flexmonster/kxde03f9/.
We kindly suggest ensuring that a JSON object is assigned to the slice: https://jsfiddle.net/flexmonster/bu5r1wk8/.
Please let us know if this helps to resolve the problem.
Its working now with the above changes suggested. Thank you for the support.