# Function useGetSharedFormula Fusion Embed

useGetSharedFormula(...args): SharedFormulaState

Fetch a shared formula (opens new window) from the a Fusion Embed instance.

The formula can be identified either by oid or by name and data source pair.

When the retrieval is successful but the shared formula is not found, the resulting formula is null. When the retrieval is not successful the resulting formula is undefined.

# Parameters

Parameter Type
...args [UseGetSharedFormulaParams]

# Returns

SharedFormulaState

Formula load state that contains the status of the execution, the result formula, or the error if any

# Example

An example of retrieving a shared formula by oid:

const { formula, isLoading, isError } = useGetSharedFormula({ oid: 'd61c337b-fabc-4e9e-b4cc-a30116857153' })

# Example

An example of retrieving a shared formula by name and data source:

const { formula, isLoading, isError } = useGetSharedFormula({ name: 'My Shared Formula', datasource: DM.DataSource })