Page 1 of 1

Multiple Where values in Mapping

Posted: Thu Dec 31, 2020 4:08 am
by DeathgripVT

Hello,

I am trying to perform a mapping event for a DB query service. I need to have the query pull data where to_users._id (Column Name) = UserData.id (Storage Variable) and profile (Column Name) = SelectedProfile (Storage Variable).

My current code within the TS of the "where" mapping (Attached screen shot):

var profile = this.Apperyio.data.getStorage("SelectedProfile");
var q = '{"$and":[{"to_users._id":"'+value+'"},{"profile":"'+profile+'"}]}';
return q;

I can't quite get the syntax to work properly. I do not get any errors but it also does not return anything.

Thank you,
John


Re: Multiple Where values in Mapping

Posted: Mon Jan 04, 2021 5:08 pm
by Serhii Kulibaba

Hello,

Please use a simple TS code here:

Code: Select all

const profile = this.Apperyio.data.getStorage("SelectedProfile");

return {"$and":[{"to_users._id": value},{"profile": profile}]};