Hi All,
I have downloaded the original To Do Application for OSDK, and I opened it using VS inside Foundry.
I then created a function in Foundry which I am trying to bring into my application. The function has the API Name: osdkTodoTaskSummarisation1
- I tried using Typescript Version 1.0 Method to get the function: (Which I got from Docs on Loading Functions)
client.ontology.queries
.osdkTodoTaskSummarisation1({ osdkTodoProject: projectitem });
But when I do this, it says it cannot recognise the function and can’t find it, which is the issue.
- I then tried using Typescript Version 2.0 Method: (Which I got from importing my function into osdk, and the doc to use it)
const result = await client.ontology.queries.osdkTodoTaskSummarisation1({
"osdkTodoProject": "{primaryKeyValue}"
});
But when I use this. it says some weird error about my client:
This expression is not callable.
Type 'FoundryClient<PublicClientAuth>' has no call signatures.ts(2349)
- I am not sure what the issue is, I made sure to import the Function into the osdk. Do I need to refresh something for it to work? The only thing I am confused about is, in my developer console it says I have the function imported in. (Which is where I got the code from). However When I am in my Visual Studio Code, on the left hand side if I click 'Ontology" it only shows objects and actions. (Not sure if my function should be appearing here).
Anyone have any ideas which code I should be using, and then why it’s not working.
I have attached my code below:
import { MockProject} from "./mocks";
import client from "./client"
function aipfunction(projectitem: MockProject| null): string {
if (!projectitem) {
return "hey"
}
const FunctionV1 = client(osdkTodoTaskSummarisation1)({
"osdkTodoProject": pk
});
const FunctionV2 = client.ontology.queries
.osdkTodoTaskSummarisation1({ osdkTodoProject: projectitem });
//const finaloutput = FunctionV2.value.value
return projectitem.id;
}
export default aipfunction;