Hello everybody!
I have been searching for a solution to this but with no luck :(
I am trying to do the following thing:
Elements on the page:
1. An input slider (#slider1)
![](https://static.wixstatic.com/media/a27d24_46e1ddc7b633412c9d6b4cfbf0ef80aa~mv2.jpg/v1/fill/w_223,h_50,al_c,q_80,enc_auto/a27d24_46e1ddc7b633412c9d6b4cfbf0ef80aa~mv2.jpg)
2. A text field (#text74)
![](https://static.wixstatic.com/media/a27d24_f5421ccbdcc04849a7886ee0625f5e09~mv2.jpg/v1/fill/w_321,h_53,al_c,q_80,enc_auto/a27d24_f5421ccbdcc04849a7886ee0625f5e09~mv2.jpg)
3. A dataset on the page (#dataset1)
![](https://static.wixstatic.com/media/a27d24_efe24e5677944b428d7bcb6408c60061~mv2.jpg/v1/fill/w_475,h_185,al_c,q_80,enc_auto/a27d24_efe24e5677944b428d7bcb6408c60061~mv2.jpg)
What I would like to do is changing the text when changing the slider value (#slider1). I already know how to trigger a function using the onChange according to the value.
However I cannot find a way to retrieve a specific text from a richText column inside the dataset and inserting it into the text field (#text74).
An example of the code:
export function slider1_change(event) {
let value = $w("#slider1").value;
if (value >= 0 && value < 1) {
// RETRIEVE RichText IN RAW 1, COLUMN 2 FROM DATASET (#dataset1) INSERT THAT RichText IN THE TEXT FIELD(#text74)
} else if (value >= 1 && value < 2) {
// RETRIEVE RichText IN RAW 2, COLUMN 2 FROM DATASET (#dataset1) INSERT THAT RichText IN THE TEXT FIELD(#text74)
} else if ...
};
I have tried several options but I cannot find a way to retrieve that text :(
Thank you in advance for your help!
Peter
Which approach you use for this will depend on where your text is and what kind of dataset it's connected to. Is it a dynamic page? Is it in a repeater?
Also keep in mind you can rewrite your conditional statements like this:
if (0 <= value < 1) { }...