Skip to content

How to use user_id of logged-in user to filter data? #1099

Answered by novotny1akub
novotny1akub asked this question in Q&A
Discussion options

You must be logged in to vote

I must have messed up something because when I tried a more simplified example today, it works without any problems. Apologies for the question. Here is my example of dynamically loaded data:

---
toc: false
---

# Fetching Data Dynamically

Select a Star Wars character id using the slider (https://swapi.dev/documentation)
```js
const star_wars_id = view(Inputs.range([1, 15], {step: 1, value: 4}));
```
<div>
  <b>id=${star_wars_id}</b>
  <p>Star Wars character name: <b>${fetchData()}</b> <p> 
  <p>(character name loaded dynamically from an API)</p>
</div>

```js

async function fetchData(){

    const url = `https://akabab.github.io/starwars-api/api/id/${star_wars_id}.json`;
    const resp…

Replies: 1 comment 2 replies

Comment options

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

@novotny1akub
Comment options

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