1

From these 2 lines I am getting a promise in my console but not getting how I can access the values from it.

const name = fin.Application.getCurrentUser().getName();
console.log(name);

The result which I am getting in console is:-

Promise {<pending>}
[[Prototype]]: Promise
[[PromiseState]]: "fulfilled"
[[PromiseResult]]: Object

In [[PromiseResult]]: Object there is a field for name and I want to access it.

Promise {<pending>}
[[Prototype]]:Promise
[[PromiseState]]:"fulfilled"
[[PromiseResult]]:Object
      name:{} 

How it can be done? I have tried it using then() but not getting the desired result. Like this:- const app = fin.Application.getCurrentUser().getName().then((app) => console.log(app));

0 Answers0