@givemeawhisky I’m trying to call data from a dataset & add it to repeater but for everyone.
I just one to know how can i take data from database for every repeater item
Like in the place const what should i write to take the data is this right?
const id = “xxxxxxxxxxxxx”; // in id i want to take my database title field data & here id is just use for data
let id = $w(“#mydatabase”).getCurrentItem().title; //is this correct
And when i’m trying to do this it shows the error wixcode error database does not exist.
Full Example i’m trying to code
import { fetch } from 'wix-fetch';
import wixData from 'wix-data';
export async function getData() {
const apiKey = "apikey";
const id = "asdahdkjafhk65156"; //example value | but when i'm putting the right value it works for one but i'm looking to get database data for every repeater item with different values. I hope you understand
let id = wixData.get('#myDatabaseName', 'title'); //Not working after deleting const id above
//imaginary url example below
const response = await fetch("https://www.exampleapi.com/data/d5/feed?&id=" + id + "&key=" + apiKey, {
method: 'get'
});
All this code for the backend
#backend #database