top of page

Forum Posts

jobbojnr
Nov 06, 2020
In Coding with Velo
Hey there, On my site, users use sliders to award themselves points. Once they reach a certain number of points the text on their 'badge' changes to reflect. I've done this using the below code in the backend. What I'm also trying to do is hide a vector image (revealing their new badge) on a single page. I think where I'm stuck is all of my below if statements are in the backend and I'm not sure how to write the code that pulls that data from the dataset and effects the vector image for a single page. export function NewUserData_afterQuery(item, context) { if (item.sum <= 250) { item.badge = "Brand New";}  if (item.sum > 250) { item.badge = "Beginner";}  if (item.sum >= 8500) { item.badge = "Serious";} if (item.sum >= 16500) { item.badge = "Legendary";} return item;}
0
1
72
jobbojnr
Aug 21, 2020
In Coding with Velo
Hey, When a user inputs using a slider, I want to auto save to the collection without a button. The code I'm using (below) does this, however it saves at the first point the slider reaches instead of where it finishes. Eg The slider has two steps 0 - 50 - 100, when sliding to 100 it will stop at 50 and save, then the user needs to go back and slide again from 50 - 100. (hope that makes sense). It's almost as if I need to user an afterChange event instead of an onChange or add a delay into the code ... any ideas folks? export function slider21_change(event) {     $w('#dataset3').setFieldValue("boil",$w('#slider21').value); $w('#dataset3').save()     .then((item) => {         console.log("data was saved.")         ;     })     .catch((err) => { let errMsg = err;     });  }
0
4
84
jobbojnr
Aug 04, 2020
In Coding with Velo
Hey there, Hoping someone somewhere has the skills to help me out... I'm using selection tags. The user clicks the tag to add to a collection. This collection is basically a 'to do list' that can be added to from anywhere on the site using tags (via a write only dataset), then accessed via a dedicated 'to do list' page which uses a repeater to show the list (Read & Write). I have it all working perfectly except I'd like the tag to be submitted without using a button to submit it. Currently they click the tag then click a submit button which works but causes other problems. Is there a way for the info on the tag to auto-submit to the collection when pressed? I'm thinking it will involve the on_click function on the tag, including some kind of submit function followed by the save function. So far I have the below, but this saves a blank line in the collection .... any ideas please?? export function selectionTags1_click(event) {     $w("#dataset6").save(); }
0
4
38
jobbojnr
May 24, 2020
In Coding with Velo
Hey there, I have a dataset, which contains points that users award to themselves. When they have achieved a certain milestone, they slide a slider across to award themselves a certain amount of points. This all works fine until they hit the submit button. The only way I can get the data to save after hitting submit, is if the submit button then links to another page. When they then return to the original page the points are saved. What I'd like is for the points to be submitted to the dataset whilst remaining on the same page. Any ideas anyone? Appreciate any help. Cheers, Andy
0
2
34
jobbojnr
May 24, 2020
In Coding with Velo
Hey there, I have a dataset that users can edit with points (when they achieve certain milestones they award themselves points). What I'd like is when a user Signs in for the first time, each column in the database is automatically populates with a zero. Any ideas on how this can be done? I've found a work around whereby the user, after logging in, can populate this themselves but if they miss it it causes problems, and it's just not that slick.\ Really appreciate any help folks.
0
2
35
jobbojnr
Apr 04, 2020
In Coding with Velo
Hey, Hoping someone can help please ... I have a dataset that is populated by my users. They give themselves points when they've achieved something. I've noticed today that within the dataset a single owner can have several ID's with different data in. I figured maybe it creates a new ID every time the user updates it, but for my own test account, which has been updated hundreds of times, there is only 1 x ID. Example below shows my friends owner code with 3 different ID rows and my own (test) owner code with just the one ID row. It's not a problem now as the live website will show the correct amount of points, but in the future when I need to export the data, edit it and re-import it, it's going to cause problems. And, I'm just trying to understand the inconsistency of it. Any ideas anyone? Thanks a million
Dataset has several IDs for one Owner content media
0
0
19

jobbojnr

More actions
bottom of page