Need a special offer?Find out if your project fits.
+

Slice Data in an object is not binding.

Resolved
Kranthi asked on September 3, 2019

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.  

Attachments:
SliceObj.PNG

4 answers

Public
Vera Didenko Vera Didenko Flexmonster September 3, 2019

Hello, 
 
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.
 
Best Regards,
Vera

Public
Kranthi September 4, 2019

Hi Vera,
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.
 
Thanks,
Kranthi 

Attachments:
SliceObjData.PNG

Public
Vera Didenko Vera Didenko Flexmonster September 5, 2019

Hello, Kranthi,
 
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.
 
Best Regards,
Vera

Public
Kranthi September 9, 2019

Hi Vera,
Its working now with the above changes suggested. Thank you for the support.
Thanks,
Kranthi

Please login or Register to Submit Answer