Forum Discussion
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;
Ok great, thanks a lot for this valuable information! I played around but I still can't get the data to load successfully. I attached my code if it will provide some clarity and thanks so very much for your insights! Greatly appreciated!
- AssafHanina03-04-2025Sisense Employee
Hey francoisvv ,
Additionally to the API shared by steve , please consider using the Data Model api's in version 2.0.
Each API contain the Datasets, Tables and Columns information
Best Regards
- francoisvv03-11-2025Cloud Apps
Hey Assaf, I tried the suggested but I could not get it working though. I am still experimenting with both suggestions, but have not yet gotten it to work.