Skip to main content
Nintex Community Menu Bar
Question

REST datasource filter set search not working

  • July 11, 2024
  • 33 replies
  • 51 views

Forum|alt.badge.img+18

I have a rest datasource pointing to bitbucket with a query like so:

/repositories/compasscare/optimizecore/issues?q=((state={{state1}}+OR+state={{state2}}+OR+state={{state3}}+OR+state={{state4}}){{#search}}+AND+(content.raw~{{search}}+OR+title~{{search}}){{/search}})&sort={{sort}}

I counldn’t figure out how to make a ‘conditional AND’ work with a datasource query. Deactivating a condition in skuid doesn’t change the url that’s being passed, so it was confusing bitbucket, so I went with the merge syntax.

I have a filter set on the model with search properties like so:

When I run the page and type anyting in the search bar, skuid is inserting 0 into the {{search}} instead of what I’m actually searching (according to the request payload data):

https://api.bitbucket.org/2.0/repositories/compasscare/optimizecore/issues?q=((state=%22new%22+OR+state=%22open%22+OR+state=%22%22+OR+state=%22%22)+AND+(content.raw~0+OR+title~0))&sort=”"

But apparently it’s not inserting 0 into {{#search}}, becuase it’s processing the conditional merge correctly.

Help?

33 replies

Forum|alt.badge.img+18
  • Author
  • July 11, 2024

10.0.25


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Looks like conditional merge syntax works just fine for filtered conditions. I added this to the query…

{{#kind}}+AND+kind={{kind}}{{/kind}}

Filtering “kind” to “bug” with a select filter in runtime has the desired result, with the payload data url

+AND+kind=%22bug%22+


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump!!


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Anyone out there have an idea how I can get the search to work?


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Sodium Sodium
Sodium Sodium
Sodium Sodium
Sodium Sodium

Sodium Sodium
Sodium Sodium
Sodium Sodium
Sodium Sodium
BATMAN!



(also, bump)


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Commence daily bumps until resolution.


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #5


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #6


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #7

#persistentwidow


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #8

Really, Skuid? this is getting pretty embarrassing…


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #9


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #10


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

This thread has been marked “in progress”, but as far as I can tell, no progress has been made here.

I’m a fairly patient man, but my patience is wearing thin.


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #11


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #12


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Just re-read the OP and realized that the last word before “Help?” should be ‘incorrectly.’


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

bump #13


Forum|alt.badge.img+20

Hey Matt. I can get my REST expert to give you a hand. No charge. Lemeno


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Thanks, Pat. Maybe this is a REST issue, but the problem I’m seeing is that skuid is putting 0 in for the {{search}} merge, rather than the actual search term that I enter in the skuid table’s search bar.

I think if the merge syntax worked as expected, I wouldn’t have any REST problems.


Forum|alt.badge.img+20

Got it. Lemeno


Forum|alt.badge.img+10
  • Nintex Employee
  • July 11, 2024

Hi Matt,

I hear your frustration, and I apologize that it’s taken so long for a response to come to this topic. I also see that Pat just responded as well, which is comforting, knowing his level of expertise and experience. I will be happy to join this conversation as well to find a root cause and work towards a solution. Since your reported issue involves a few layers of complexity, at a glance I’m not sure which piece I should be most suspicious of. But it sounds like you suspect that the merge variable for {{search}} is not behaving as expected. Have you found that this is only happening when you try to use it with REST data sources?

The fact that a zero is getting inserted makes me wonder - perhaps the 0 is coming into the picture because it’s the first item (item 0, if zero-indexed) in the JSON underneath… One obvious sanity check to make - have you tried triple mustaches around search, instead of double mustaches?

Ideally I’d like to boil this down as much as possible so if there’s a product issue at work, we’ll be able to understand what’s relevant for reproducing the issues. 

Have you tried a simple test of having the {{search}} by itself in the REST query? I know it would probably throw an error, but it would be helpful to see how things behave when that merge variable is by itself. 


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Mark,

Thanks for jumping in.

I’ll do my best to simplify.

First, I tried to reduce the  data source url to 
/repositories/compasscare/optimizecore/issues{{#search}}?q=title~{{search}}{{/search}}

My search bar is on a filter set on the model. When no search is entered, the request payload data url is https://api.bitbucket.org/2.0/repositories/compasscare/optimizecore/issues, as expected.

When I enter anything in the search, the data url is 
https://api.bitbucket.org/2.0/repositories/compasscare/optimizecore/issues?q=title~0
Where 0 is being entered for the {{search}} merge. Something other than 0 seems to be getting passed to the {{#search}} conditional merge syntax, though, because the contents between {{#search}} and {{/search}} are being evaluated (unless 0 counts?).

Triple mustache yields the same result.


Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Next, I tried to simplify the data source url further, to

/repositories/compasscare/optimizecore/issues?q=title~{{search}}

I found that the source was returning [Object object], until I put quotes around the search, which leaves me with a data source url like this:

/repositories/compasscare/optimizecore/issues?q=title~“{{search}}”

That actually worked as expected!!!



Forum|alt.badge.img+18
  • Author
  • July 11, 2024

Now, the trick is to work backwards to get all the conditions back in there as needed.

When I tried a data source url like this:

/repositories/compasscare/optimizecore/issues{{#search}}?q=(content.raw~“{{search}}”+OR+title~“{{search}}”){{/search}}

I got the 0 again for {{search}}.

So, the issue clearly has something to do with the interaction between the conditional merge syntax and the regular merge syntax. 

I dropped the conditional merge syntax, and went with this
/repositories/compasscare/optimizecore/issues?q=(content.raw~“{{search}}”+OR+title~“{{search}}”)

And it worked again!