Skip to content

Trouble doing something as simple as api.getNote(noteID)... Help? #4210

Answered by rauenzi
sottey asked this question in Q&A
Discussion options

You must be logged in to vote

You're right this appears to be not working in the beta. @zadam is FNote.getContent() no longer meant to work in the beta? I'm guessing no since it's not documented in the jsdoc and ultimately replaced with getBlob right?

For now, sottey, you can just do this:

function getNoteContent(noteId) {
    return api.runOnBackend((id) => api.getNote(id).getContent(), [noteId]);
}

var noteContent = await getNoteContent("TR2pVO3d7opK");
alert("noteContent: " + noteContent); 

this method should work on both stable and the beta

or if you only care about the beta you can move to getBlob which returns a promise that resolves to the FBlob object that has a content member like this:

async function getNot…

Replies: 5 comments 10 replies

Comment options

You must be logged in to vote
2 replies
@rauenzi
Comment options

@sottey
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@sottey
Comment options

@sottey
Comment options

@sottey
Comment options

@sottey
Comment options

Comment options

You must be logged in to vote
3 replies
@rauenzi
Comment options

Answer selected by sottey
@zadam
Comment options

@rauenzi
Comment options

Comment options

You must be logged in to vote
1 reply
@rauenzi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants