# Function useGetNlqResult Beta

useGetNlqResult(...args): UseGetNlqResultState

React hook that enables natural language query (NLQ) against a data model or perspective.

Note

This hook is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.

# Parameters

Parameter Type
...args [UseGetNlqResultParams]

# Returns

UseGetNlqResultState

NLQ load state that contains the status of the execution, the result (data) as WidgetProps

# Example

const { data, isLoading } = useGetNlqResult({
   dataSource: 'Sample ECommerce',
   query: 'Show me total revenue by age range'
});

if (isLoading) {
  return <div>Loading...</div>;
}

return (
  {
     data &&
     <Widget {...data} />
  }
);