Reputation: 1
I'm having some issues with a custom plugin I created where the method buildfire.userData.search() is no longer working due to an error.
Please note that evertyhing was working ok before the latest Buildfire SDK update. At first the app was no longer working on https://app.buildfire.com/, and then I had the same issue locally after I manually updated the SDK.
I did check the userdata.search documentation and I see this has not changed https://sdk.buildfire.com/docs/user-data#search-
Any ideas on what the problem is and how I can fix this?
Error screenshot: https://i.sstatic.net/IqfNo.png
Thanks in advance!
Upvotes: 0
Views: 133
Reputation: 324
Since you're doing a navigation to other pages the easiest thing to do is copy over all querystring you receive on your index.html to the other pages when navigating away from the index page. that should fix all issues.
Upvotes: 0
Reputation: 324
The following snippet runs fine on the latest (1.75.1) on my end. can you run and verify result
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../scripts/buildfire.min.js"></script>
</head>
<body>
<script>
buildfire.userData.search(
{
filter: {
$or: [
{ "$json.rank": { $gt: "600", $lt: "900" } },
{ "$json.name": "Jane Doe" },
],
},
sort: { rank: 1, lastName: -1 },
fields: ["rank", "lastName"],
skip: 20,
limit: 10,
},
"contactInfo",
(err, result) => {
if (err) return console.error("there was a problem retrieving your data");
console.log("Records found: ", result);
}
);
</script>
<span>Widget - Hello, world!</span>
</body>
</html>
I would check also if there is any redirection happening on the plugin page causing the plugin to lose the instant context.
Upvotes: 0