Hi, I have a collection with two text fields, "tag1" and "tag2"
In the code, I'd like to concatenate the two text fields into a string variable, like this:
var tagConcat = ("tag1" & "tag2");
Except, that doesn't work. The following does not work either:
var tagConcat = ("tag1" + "tag2");
Anyway to combine the text of "tag1" and "tag2" in a variable called tagConcat?
Thanks!
Hi
Similar question
i would like before saving the entry
concatenate 2 numeric fields NfieldA and NfieldB with an alpha field (AfieldC) and fulfilled the result into field D already set in the form-
How i can do this concatenation and also the update info this field D-
Those 4 fields will be recorded into the database after saving
thanks for your help
regard
yann
Hi, I came across a similar problem a few weeks back. Have you tried using an or() condition?
https://www.wix.com/code/reference/wix-data.WixDataQuery.html#or
So, I think your solution would be something like this...
export function filterInput_change(event) { $w("#dataset1").setFilter(wixData.filter() .contains("tag1", $w("#filterInput").value) .or( wixData.filter() .contains("tag2", $w("#filterInput").value) )); }
This is the thread where I posted and got the answer!
https://www.wix.com/code/home/forum/community-discussion/how-to-query-multiple-fields-in-a-dataset
Hi,
You can try the following:
let tagConcat = `${$w('#tag1').value} ${$w('#tag2').value}`;
Good luck!
Tal.