Excel Custum function: Can't fetch data from a local API

%3CLINGO-SUB%20id%3D%22lingo-sub-1606192%22%20slang%3D%22en-US%22%3EExcel%20Custum%20function%3A%20Can't%20fetch%20data%20from%20a%20local%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1606192%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20recently%20tried%20to%20create%20my%201st%20custom%20function%20for%20Excel.%3C%2FP%3E%3CP%3EWhen%20I%20try%20to%20fetch%20data%20from%20a%20%3CSTRONG%3Elocal%20web%20API%3C%2FSTRONG%3E%2C%20I%20get%20the%20error%20%3CSTRONG%3E%23value%3C%2FSTRONG%3E..%20From%20my%20local%20API%2C%20I%20dont%20even%20find%20any%20access%20attempt%3C%2FP%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%20async%20function%20fetchData()%20%7B%0A%0A%20%20%20%20try%20%7B%0A%20%20%20%20const%20url%20%3D%20%60http%3A%2F%2Fxxxxxxxxxx%3A3001%2Fapi%2Fv1%2Ftest%60%3B%0A%20%20%20%20const%20response%20%3D%20await%20fetch(url)%3B%0A%20%20%20%20%2F%2FExpect%20that%20status%20code%20is%20in%20200-299%20range%0A%20%20%20%20if%20(!response.ok)%20%7B%0A%20%20%20%20%20%20throw%20new%20Error(response.statusText)%0A%20%20%20%20%7D%0A%2F%2F%20.....%20post%20treatment%0A%20%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1606192%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

I've recently tried to create my 1st custom function for Excel.

When I try to fetch data from a local web API, I get the error #value.. From my local API, I dont even find any access attempt

 

 

 

 

 async function fetchData() {

    try {
    const url = `http://xxxxxxxxxx:3001/api/v1/test`;
    const response = await fetch(url);
    //Expect that status code is in 200-299 range
    if (!response.ok) {
      throw new Error(response.statusText)
    }
// ..... post treatment
  }

 

 

 

0 Replies