KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Solutions Is there a way to store data returned from server into a viewstate in KX Dashboard?

  • Is there a way to store data returned from server into a viewstate in KX Dashboard?

    Posted by yuwu10112358 on November 8, 2022 at 12:00 am

    Hello,

    Here is my use case: I am trying to build a dashboard where each user can construct a dataset S for viewing, and user can further interact with S using various controls. Here are the problems I have:

    – although S itself is small, computing S takes significant amount of time, and there are various interactive components on the dashboard that depends on S as data source so they need to query S over and over again

    – S is different for different users

    My idea for solving these problems is to cache S for all users on the server side, and for each user, once they compute their S, they can just looked up the cached S every time they need S again. However this solution would require the server being able to send a key for S back to each user, and I have yet to find any documentations on how KX dashboard could use data returned from server as value to assign to view state. Did I miss something or is there a good reason for not having this capability? If the latter is the case, what other solutions can I try for my use case?

     

    Thank you very much in advance!

    yuwu10112358 replied 8 months, 2 weeks ago 2 Members · 2 Replies
  • 2 Replies
  • leahs

    Member
    November 11, 2022 at 12:00 am

    Hello @yuwu10112358

    Thanks for sharing with the KX Community.

    Reverting with some feedback for you:

    There are a few options here:

    1. Server side caching solution is recommended.

    2. Use a virtual query. If several components are using the same datasource, then there can be one q query and link each of the components to a virtual datasource

    3. In the query, return the table as a dictionary and use the query mapper to map the table to a viewstate

    Hope this helps.

    Thanks, 

    Leah

     

  • rocuinneagain

    Member
    November 14, 2022 at 12:00 am
  • yuwu10112358

    Member
    November 14, 2022 at 12:00 am

    Thank you for the feedbacks! Sorry if this is a dumb question, but what is a query mapper?

Log in to reply.