Forum Discussion

francoisvv's avatar
francoisvv
Cloud Apps
03-04-2025

Get a list of Datasets in an elasticube with ComposeSDK

I want to create a dropdown containing all the tables/datasets within a specific elasticube with React.  I created a dropwdown that I can populate all the elasticubes in my instance with, but I want to be able to see the list of datasets from that elasticubes but I am struggling to find the api end-point or if there is another way.  Ideally would then also like to be able to build a table, containing all the data from that table, once selected, but trying to take it one step at a time 🙂  Any advise would be greatly appreciated.

7 Replies

  • steve's avatar
    steve
    Sisense Employee

    Hi francoisvv 

    We're hoping to add some things in future that could make some of this easier, but for now if you're using React then you can try using useFetch with /api/datasources/<modelname>/fields/search API

    Here's a quick / basic example, hope it helps

    import { useFetch } from "@sisense/sdk-ui";
    import { measureFactory } from "@sisense/sdk-data";
    
    const CodeExample = () => {
      const { data, isLoading, error } = useFetch<unknown, Error>(
        "api/datasources/Sample%20ECommerce/fields/search",
        {
          method: "POST",
          body: JSON.stringify({
            offset: 0,
            count: 50,
          }),
        }
      );
    
      data && console.log(data);
    
      return (
        <>
          {data &&
            data.map((row) => (
              <p>
                Table: {row.table}, Dim: {row.id}, Title: {row.title}
              </p>
            ))}
        </>
      );
    };
    
    export default CodeExample;
  • Hello francoisvv,

    I’m following up to see if the solution offered by steve and AssafHanina worked for you.

    If so, please click the 'Accept as Solution' button on the appropriate post. That way other users with the same questions can find the answer. If not, please let us know so that we can continue to help.

    Thank you.

    • francoisvv's avatar
      francoisvv
      Cloud Apps

      Hey David,

      Thanks for following up.  Currently I have not gotten it to work with the suggested solutions.

      • DRay's avatar
        DRay
        Admin

        Hi francoisvv,

        I'm sorry to hear that. Would you like me to get the ball rolling on finding a technical resource to work with you directly to help get this implemented?