top of page

Forum Posts

Code-Ninja
Top Contributor
Top Contributor
Jun 18, 2023
In Coding with Velo
Why not every element do not provide a label ? What abbout So we can cleary see, that we even have the option to change the S-Tag-Elemnt's label, ...but looking onto the VELO-API-DOCS.... ....there is no given possibility to manage the label of the Selection-Tags. WHY ???? So why the label-property is not included ???
Selection-Tags (label missing) content media
0
2
10
Code-Ninja
Top Contributor
Top Contributor
Jun 01, 2023
In Coding with Velo
ERROR: Request throttled, too many requests by RegisterIpThrottler On one hand it makes sense, but in my case i am using the registration-process to add a new BADGE to an existing user. Is there a way to bypass PROTECTION-FUNCTION, which turns on after several registration attempts? 1) And what exactly is the max limit of attempts to register the same member? 2) Or do the protection also woks, when registering several different members?
How to avoid or bypass "RegisterIpThrottler"-limitation/protection, going through registration process?  content media
0
0
3
Code-Ninja
Top Contributor
Top Contributor
Jun 01, 2023
In Coding with Velo
This error occurs, when you have to many fails while registering a user with same e-mail.... How to reset this, when the error occured??? 1) How to prevent such error? 2) How to reset such error? 3) What is the max limitation of failed registration-attempts? 4) Where to find all these info?
How to prevent such an error?  content media
0
0
7
Code-Ninja
Top Contributor
Top Contributor
May 25, 2023
In Velo Pro Discussion
myElements [1].onChange(()=>{if(myElements [1].valid) {myElements [1].style.backgroundColor=colorValidityOk;} else{myElements [1].style.backgroundColor=colorValidityNotOk;}}); myElements [2].onChange(()=>{if(myElements [2].valid) {myElements [2].style.backgroundColor=colorValidityOk;} else{myElements [2].style.backgroundColor=colorValidityNotOk;}}); myElements [3].onChange(()=>{if(myElements [3].valid) {myElements [3].style.backgroundColor=colorValidityOk;} else{myElements [3].style.backgroundColor=colorValidityNotOk;}}); myElements [4].onChange(()=>{if(myElements [4].valid) {myElements [4].style.backgroundColor=colorValidityOk;} else{myElements [4].style.backgroundColor=colorValidityNotOk;}}); myElements [5].onChange(()=>{if(myElements [5].valid) {myElements [5].style.backgroundColor=colorValidityOk;} else{myElements [5].style.backgroundColor=colorValidityNotOk;}}); myElements [6].onChange(()=>{if(myElements [6].valid) {myElements [6].style.backgroundColor=colorValidityOk;} else{myElements [6].style.backgroundColor=colorValidityNotOk;}}); myElements [7].onChange(()=>{if(myElements [7].valid) {myElements [7].style.backgroundColor=colorValidityOk;} else{myElements [7].style.backgroundColor=colorValidityNotOk;}}); myElements [8].onChange(()=>{if(myElements [8].valid) {myElements [8].style.backgroundColor=colorValidityOk;} else{myElements [8].style.backgroundColor=colorValidityNotOk;}}); myElements [9].onChange(()=>{if(myElements [9].valid) {myElements [9].style.backgroundColor=colorValidityOk;} else{myElements [9].style.backgroundColor=colorValidityNotOk;}}); myElements[10].onChange(()=>{if(myElements[10].valid) {myElements[10].style.backgroundColor=colorValidityOk;} else{myElements[10].style.backgroundColor=colorValidityNotOk;}}); myElements[11].onChange(()=>{if(myElements[11].valid) {myElements[11].style.backgroundColor=colorValidityOk;} else{myElements[11].style.backgroundColor=colorValidityNotOk;}}); myElements[12].onChange(()=>{if(myElements[12].valid) {myElements[12].style.backgroundColor=colorValidityOk;} else{myElements[12].style.backgroundColor=colorValidityNotOk;}}); myElements[13].onChange(()=>{if(myElements[13].valid) {myElements[13].style.backgroundColor=colorValidityOk;} else{myElements[13].style.backgroundColor=colorValidityNotOk;}}); myElements[14].onChange(()=>{if(myElements[14].valid) {myElements[14].style.backgroundColor=colorValidityOk;} else{myElements[14].style.backgroundColor=colorValidityNotOk;}}); For example somehow push this though a LOOPING ? Somwone any idea of how to mage this in a more dynamic way, instead of coding it static onto the page for each of the event-triggers?
Is there a way, to get this more flexible, variable and more compressed? content media
0
4
43
Code-Ninja
Top Contributor
Top Contributor
May 25, 2023
In Coding with Velo
Found error in PAGE ---> on --> CHILDREN-PROPERTY..... let myChildren = $w("#page1").children; console.log(myChildren); Result.... This should normly not happen! Where is the whole OBJECT ??? That works, but not enough! let firstChild = myChildren[0]; console.log(firstChild); Please fix that bug! Thanks!
Page-Element has a bug!!! ---> CHILDREN <--- property. content media
0
2
14
Code-Ninja
Top Contributor
Top Contributor
May 23, 2023
In Coding with Velo
This happens, when doing to many registration-attempts How to reset this, when the error occured??? 1) How to p r e v e n t such e r r o r? 2) How to r e s e t such error? 3) What is the max limitation of f a i l e d r e g i s t r a t i o n - a t t e m p t s ? 4) Where to find all these info?
ERROR while REGISTRATION-prozess content media
0
0
18
Code-Ninja
Top Contributor
Top Contributor
Apr 27, 2023
In Velo Pro Discussion
Like the title already shows, i want to preview an IMAGE on my page ---> BEFORE-UPLOAD <-- on my page. I know how to achieve this --> by using the HTML-Component, but i can't find a way of how to use for example Node-FS (File-System) to get it to work. What do i need to know about FS ??? 1) Works only on Backend (checked) !!! 2) Don't have to install any NPM, because already included (checked), 3) Am i able to open directly a FILE (for example an ordinary TXT-File) on my computer, without first have to upload the TXT-File??? 4) If there is no ability to open a Blob-Window directly, how to proceed else (workaround) ? 5) What would be the right PSEUDO-CODE-CONSTRUCT to use FS ??? 6) How would look like a working ---> PATH ? a) --> c:/xxxx/yyyyy/zzzzz/text.txt <--- ? (opening from local machine possible) b) --> https://www.zzzzzzz.com/..../text.txt ??? 7) What else do i need to know, to be able to use FS the right way? Example??? import fs from'fs'; let PATH = "??????????????"; let dataBuffer = fsExtra.readFileSync(PATH);
0
2
34
Code-Ninja
Top Contributor
Top Contributor
Apr 23, 2023
In Velo Pro Discussion
When it will be possible to generate/create a new collection/database by code, defining also all it's DB-Field-Types by code aswell? @wix If you need some code for it..... import wixData from 'wix-data'; const collectionSchema = { "title": "My Collection", "description": "This is my collection schema", "fields": [ { "name": "name", "type": "text" }, { "name": "age", "type": "number" }, { "name": "email", "type": "email" }, { "name": "dateOfBirth", "type": "date" }, { "name": "isSubscribed", "type": "boolean" }, { "name": "avatar", "type": "image" }, { "name": "description", "type": "text" }, // Add more fields here ] }; wixData.createCollection("myCollection", collectionSchema) .then((collection) => { // Collection has been created with the defined schema console.log(`Collection ${collection.title} created successfully`); }) .catch((error) => { console.error(`Failed to create collection: ${error}`); }); It is time to implement this function/method to the Wix-Data-API to expand the features and functions of Wix-Data. I hope this won't take any longer, since the CODE is already here 😁 Make it possible for us, to create databses the dynamic way (by code), instead to generate them all the time manually inside the Content-Manager. A -------> FAST-SOLUTION <------- IS VERY APPRECIATED ! Thanks for hearing my voice.
2
7
45
Code-Ninja
Top Contributor
Top Contributor
Apr 11, 2023
In Coding with Velo
Sorry Amanda, i did not see your post.... What was the message?
POST deleted... content media
0
1
20
Code-Ninja
Top Contributor
Top Contributor
Oct 12, 2022
In Velo Pro Discussion
Hello, it's not often that i write here, but it seems i have a problem, which makes me crazy! What i am talking about? I am trying to generate a specific code to get UNIQUE-DATA out of DATABASE using Wix-Data. It works! async function create_UniqueDropdown(items, DBFIELDS, dropdown) {console.log(items) const uniqueTitles = await getUniqueTitles(items); console.log("Unique-Titles: ", uniqueTitles); $w(`#${dropdown}`).options = buildOptions(uniqueTitles); //console.log("OPTIONS: ", buildOptions(uniqueTitles)); async function getUniqueTitles(items) { let titlesOnly = await items.map(item => item[DBFIELDS]); //console.log("Titles-Only: ", titlesOnly); return [...new Set(titlesOnly)]; } function buildOptions(uniqueList) { return uniqueList.map(curr => { return {label:curr, value:curr}; }); } } But my aim is to modify it the way, that the user can choose the exact DB-field to be unified and get all results of the selected field(s). At least DBFIELDS must be an ARRAY, or even an OBJECT. The shown code runs good for just one DB-Field, but would quickly get very slow when working for several DB-fields. So my idea was to use promiseAll(), but this is exactly my issue, no matter what i tried, i could not get a satisfying result. Maybe one of you have a good idea? Aim-1: --> eleminating all --> asynchronity (async-await) Aim2: ---> modifiying this function into a multi-DB-FIELD one. So the Input for DBFIELDS would be an ARRAY for example... DBFIELDS = ["dbField1", "dbField2", "dbField3", ......] And as result would be expected all UNIQUE-ITEMS for each of the DB-FIELDS --> compressed into an ARRAY or Object.
0
8
65
Code-Ninja
Top Contributor
Top Contributor
Sep 12, 2022
In Coding with Velo
Hello everyone! I have a problem to get my PayPal-REST-API to work. My problem is about the PayPal-Authentication-process using Wix-Fetch. Let's take this example here, where you try to get ACCESS-TOKEN from PayPal... export async function getAccessToken() { const response = await fetch("https://api.sandbox.paypal.com/v1/oauth2/token", { method: 'post', headers: { "Content-Type": "application/x-www-form-urlencoded", "Authorization": "Basic " + "" }, body: "grant_type=client_credentials" }); let jasonResponse = await response.json(); return (jasonResponse); } The "Authorization"-part in the "headers"-section, is the problematic part. I know what kind of type is expected and which parameters, but putting all the needed parameters directly into the CODE, does not work like it should. The authorization-process asks for a STRING-combination of.... "Basic " + "<Client-ID-Here> + ":" + <Secret-ID-Here> Should be something like... "Authorization": "Basic " + "Client-ID-Here" + ":" + "Secret-ID-here" Regarding the CURL-CODING... So, expected is a BASE64-encoded ClientID-Secret-combination separated by a ---> ":" 'Authorization: Basic {Your Base64-encoded ClientID:Secret}' Using POSTMAN, everything looks good and you get the ACCESS-TOKEN without any problems.... You get something like.... { "scope": "https://api.paypal.com/v1...., "access_token": "A21AAIESP7kstuC1o-5aIA8...", "token_type": "Bearer", "app_id": "APP-80W284485P...T", "expires_in": 32399, "nonce": "2022-09-12T15:05:08Z..." } ...including the token-type and the token itself. But when doing it directly without the usage of POSTMAN, you get a complete different response... ...something like.... Response: {...}jsonWixCode_Console_Table_ViewWixCode_Console_Copy_JSON url: "https://api.sandbox.paypal.com/v1/oauth2/token" status: 200 statusText: "OK" headers: {...} ok: true body: {...} bodyUsed: false size: 0 timeout: 0 _raw: [...] _abort: false Where you are able to find some buffered binary-data... So still a step missing?
PayPal-Right Authentication-form content media
0
5
58
Code-Ninja
Top Contributor
Top Contributor
Aug 05, 2022
In Coding with Velo
It seems like i can't solve an issue, related to --> "PromiseAll"-method. Lets say we have 3 queries ... //--------------------------------------------------------------------- query[1]={}, query[2]={}, query[3]={}; //------------------------------------------ query[1]["database"] = DATABASE[1]; query[1]["console"]= {log:true, password:"console"}; if(idFilter>0) {query[1]["filter0"]= {field:"_owner", value:userID, type:"eq"};} //<------- ID-FILTER query[1]["filter1"] = {field:dbFIELD[1], value:generalData.uniqueItems[0][dbFIELD[1]], type:"eq"}; query[1]["uniqueValues"] = {uniqueField:dbFIELD[2]}; query[1]["uniqueOptions"] = {uniqueField:dbFIELD[2], idType:"index"}; //"index/original" query[1]["uniqueItems"] = {uniqueField:dbFIELD[2]}; //"index/original" //------------------------------------------ query[2]["database"] = DATABASE[1]; query[2]["console"]= {log:true, password:"console"}; if(idFilter>0) {query[2]["filter0"]= {field:"_owner", value:userID, type:"eq"};} //<------- ID-FILTER query[2]["filter1"] = {field:dbFIELD[1], value:generalData.uniqueItems[1][dbFIELD[1]], type:"eq"}; query[2]["uniqueValues"] = {uniqueField:dbFIELD[2]}; query[2]["uniqueOptions"] = {uniqueField:dbFIELD[2], idType:"index"}; //"index/original" query[2]["uniqueItems"] = {uniqueField:dbFIELD[2]}; //"index/original" //------------------------------------------ query[3]["database"] = DATABASE[1]; query[3]["console"]= {log:true, password:"console"}; if(idFilter>0) {query[3]["filter0"]= {field:"_owner", value:userID, type:"eq"};} //<------- ID-FILTER query[3]["filter1"] = {field:dbFIELD[1], value:generalData.uniqueItems[2][dbFIELD[1]], type:"eq"}; query[3]["uniqueValues"] = {uniqueField:dbFIELD[2]}; query[3]["uniqueOptions"] = {uniqueField:dbFIELD[2], idType:"index"}; //"index/original" query[3]["uniqueItems"] = {uniqueField:dbFIELD[2]}; //"index/original" Instead of calling every query in single-step-mode, i want to use --> PromiseAlll <---, let rep1Data = await getData(query[1]); let rep2Data = await getData(query[2]); let rep3Data = await getData(query[3]); let rep4Data = await getData(query[4]); let rep5Data = await getData(query[5]); But not sure how to include exactly --> getData() Promise.all([query[0], query[1], query[2], query[3], query[4]]) .then(async(res) => { console.log(" All Queries: ", res); }); getData is a running (RETURN-FUNCTION) on BACKEND. So the question is, how to avoid several await-calls and do it just with one call inside PromiseAll ???
0
2
26
Code-Ninja
Top Contributor
Top Contributor
Dec 21, 2021
In Coding with Velo
Since there were these post here... I think many of you will have problems to work with the following APIs... 1) Authentication-API: login() onLogin() perhaps register() ,too. 2) CurrentMember-API: getMember() These are the two APIs which are involved in the described issue of the posts (on my opinion). And after some further analasying researches, i want try to explain the issued sutuation. To answer the following questions: Why does the new Member-API do not work 100%? What exactly is the reason for the instability of the new Member+Authentication-API? How to fix the problem, without beeing forced to use the old and depricated Wix-Users-API? Well to be able to explain the issued situation a little bit better, i have prepared a little TEST-ENVIRONMENT, which should simulate the issued situation, when it comes to the usage of the Wix authentication + wix-members-API. So give Mr-Persident a like, if he could help you to solve your issue ....😆🤣... How to use the example to see the ERROR? 1) Login with the given LOGIN-TEST-ACCOUNT. Take a look onto console. Log out again. 2) Activate the SWITCH of the currentMember-API and do the same again, do not forget to take a look onto the given CONSOLE-LOG-RESULTS! Log-out again! 3) Now activate both SWITCH-BUTTONS to activate all included APIs and run the test again. Take a look onto given CONSOLE-LOG-RESULTS! To understand what this example wanted to tell you --> you can show additional information by a click onto --> SHOW-DETECTED-ERRORS-button. So, i hope this example makes the issued situation more understandable for everybody. I already tried to explain this in several different posts, but i think i was not able to give a precise and good understandable answer. One person was already able to use this knowledge as a workaround... Back to the questions.... Why does the new Member-API do not work 100%? Well, like you perhaps have seen in the example, you don't have any chance to get the ID after login the direct way. The authentication.login - function.... https://www.wix.com/velo/reference/wix-members/authentication/login import { authentication } from 'wix-members'; $w('#login').onClick(async () => { const email = $w('#email').value; const password = $w('#password').value; try { await authentication.login(email, password); console.log('Member is logged in'); } catch (error) { console.error(error); } }); Don't give you anything back as result, after you have logged-in. Because of that, you will have to use (additionaly) --> the getCurrentMember() - function/API.... https://www.wix.com/velo/reference/wix-members/currentmember/getmember import { currentMember } from 'wix-members'; // Sample options value: // { // fieldsets: [ 'FULL' ] // } currentMember.getMember(options) .then((member) => { const id = member._id; const fullName = `${member.contactDetails.firstName} ${member.contactDetails.lastName}`; return member; }) .catch((error) => { console.error(error); }); To get informations about the current logged-in user. But even this do not work --> 100%. The example demonstrates exacly this issue. Using the following SETUP... ...you still won't be able to get the --> ID <-- of the current logged-in-member .... ...because --> .then((member) => { <-- do not provide any results after loggin! !!! AND THIS IS PERHAPS EXACTLYTHE POINT, WHERE THE ISSUE STARTS !!! !!! And here --> onLogin()-function comes into game !!! https://www.wix.com/velo/reference/wix-members/authentication/onlogin import {authentication} from 'wix-members'; authentication.onLogin(async (member) => { const loggedInMember = await member.getMember(); const memberId = loggedInMember._id; console.log(`Member ${memberId} logged in:`, loggedInMember); }); Using the example and log-in with both activated functions, the login-starts to work and gives back USER-ID and all other data as RESULTS.... @Marlowe (Wix) Perhaps you can connect to the right developement team, to test my example and proove my theoretical thoughts. My conclusion: Either the VELO-API-DOCs have to be changed, or the API itself has to be optimized --> regarding either the login()-function of the --> AUTHENTICATION-API, or regarding the --> getMember()-function of the --> CurrentMember-API (Members-API).
Persistant Wix-Authentication / Wix-Members-API issue... content media
5
7
762
Code-Ninja
Top Contributor
Top Contributor
Dec 13, 2021
In Coding with Velo
Let's say i do a query on backend, sending data from frontend to backend as --> OBJECT... let options = { database: mainMenuDB, limit: 100, skip: 0 } My code on backend, get all the informations and works well. But what if i want be able to exclude one or multiple VALUES and do not include them into the --> OBJECT --> like.. let options = { database: mainMenuDB } My code breaks down, because on backend still all 3 values are expected, but 2 values are completely missing. - an if-else-statement do not help - also --> try + catch, seems not to be the wrong solution. Is there a possible solution for such a situation? BTW, this is ... let options = { database: mainMenuDB, limit: undefined, <---- ...not what i am searching for skip: undefined <---- ...not what i am searching for }
0
3
40
Code-Ninja
Top Contributor
Top Contributor
Dec 02, 2021
In Coding with Velo
Doing this way --> NO PROBLEM! Everything works! function zzz(skipValue, limitValue) { wixData.query("DATABASE") .skip(skipValue) .limit(limitValue) .find() .then((res)=>{let items = res.items; console.log("ITEMS: ", items); $w('#rep3').data = items; }); } Trying to do this way --> FAILS! What am i missing ??? let limitValue = 10; let skipValue = 20; let data = await get_AllProductsData(limitValue, skipValue); async function get_AllProductsData(limitValue, skipValue) { let query = await wixData.query("DATABASE"); if(limitValue) {query.limit(limitValue);} if(skipValue) {query.skip(skipValue);} return query.find() .then(async(res)=>{//console.log("RES-PRODUCTS: ", res); if (res.items.length > 0) {console.log("Data found!"); let items = res.items; //console.log("ITEMS: ", items); return (items); } else {console.log("No data found!"); return ([]);} }).catch((err)=>{console.log(err); return [];}); } Also tried the following... let limitValue = 10; let skipValue = 20; let data = await get_AllProductsData(limitValue, skipValue); async function get_AllProductsData(limitValue, skipValue) { let query = await wixData.query("DATABASE"); if(limitValue) {await query.limit(limitValue);} if(skipValue) {await query.skip(skipValue);} return query.find() .then(async(res)=>{//console.log("RES-PRODUCTS: ", res); if (res.items.length > 0) {console.log("Data found!"); let items = res.items; //console.log("ITEMS: ", items); return (items); } else {console.log("No data found!"); return ([]);} }).catch((err)=>{console.log(err); return [];}); } ...and also tried this one ... let limitValue = 10; let skipValue = 20; let data = await get_AllProductsData(limitValue, skipValue); async function get_AllProductsData(limitValue, skipValue) { let query = await wixData.query("DATABASE"); if(limitValue) {return query.limit(limitValue);} if(skipValue) {return query.skip(skipValue);} return query.find() .then(async(res)=>{//console.log("RES-PRODUCTS: ", res); if (res.items.length > 0) {console.log("Data found!"); let items = res.items; //console.log("ITEMS: ", items); return (items); } else {console.log("No data found!"); return ([]);} }).catch((err)=>{console.log(err); return [];}); } Can not find the right key for this issue 😅
0
4
56
Code-Ninja
Top Contributor
Top Contributor
Nov 20, 2021
In Coding with Velo
How to understand this error? The repeater works just fine, and is feeded by the result-items of a DB-Query. Is this ERROR neccessary? let collectionData = await get_AllCollectionsData(); .then((res)=>{//console.log("RES-COLLECTIONS: ", res); if (res.items.length>0) {console.log("Collection-Data found!"); let items = res.items; return (items); } else {console.log("No Collection-Data found!"); return ([]);} }).catch((err)=>{console.log(err);});
How to understand this ERROR? content media
0
5
54
Code-Ninja
Top Contributor
Top Contributor
Nov 18, 2021
In Coding with Velo
Is the query-limitation on Wix-Stores/Products = 100 ? 1) Query-50 (standard-limited-query): 2) Query-100 (increased query-limit to 100) 3) Query-101 (increased query-limit to 101) !!! What's going on ? No 1000-limit ?
Wix Stores/Products 100-query-limit? content media
0
4
128
Code-Ninja
Top Contributor
Top Contributor
Nov 16, 2021
In Coding with Velo
Wix whats going on? This simple code do not work anymore, just few hours ago, everything worked well.... $w.onReady(function () { $w('#swtReverseView').onChange(()=>{console.log("Switched!");}); }); This is a simple code for a - - > SWITCH-BUTTON. This is (not)working on a totaly blank TEST-PAGE. And here the RESULT.... And in PREVIEW-MODE --> everything OK! @Marlowe (Wix) Could you pass this on to your team?
RESOLVED: What happened wix? (Editor-X) content media
1
7
74
Code-Ninja
Top Contributor
Top Contributor
Nov 11, 2021
In Coding with Velo
Surely today will be my lucky one! 😅😁 Wish me luck --> I should play a round of the lottery today!
Lucky day? ---> 777 content media
4
7
75
Code-Ninja
Top Contributor
Top Contributor
Nov 08, 2021
In Coding with Velo
What does tell me this error exactly, which i get since today, without have done any changes on my editor?
Import-Error content media
0
2
40

Code-Ninja

Top Contributor
+4
More actions
bottom of page