DeathgripVT
Posts: 5
Joined: Tue Dec 01, 2020 3:41 pm

Multiple Where values in Mapping

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

Attachments
issue2.PNG
issue2.PNG (34.53 KiB) Viewed 3181 times
issue1.PNG
issue1.PNG (51.26 KiB) Viewed 3181 times
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Re: Multiple Where values in Mapping

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}]};

Return to “Issues”