Like Operator not working
Question

Hi guys

I'm trying to filter by using like operator in rest api response but it doesn't seem to work!
I'm using some thing like this:

GetAllUsers.Out1.Current.UserName like "%" + searchKeyword + "%"

I am working in reactive web, Can someone help in fixing this issue.

mvp_badge
MVP
Solution

Hi Jahnavi,

PFA


Regards,

Benjith Sam

Sample1.oml

Benjith Sam wrote:

Hi Jahnavi,

PFA


Regards,

Benjith Sam

 

 Thank you Benjith Sam, I have achieved my output.

mvp_badge
MVP

Jahnavi Sagi wrote:

 Thank you Benjith Sam, I have achieved my output.

You are welcome, Jahnavi :)

Glad I could be of help!


Regards,

Benjith Sam

mvp_badge
MVP

Hi Jahnavi,

can you share some images of code where are using it.


Regards

Rahul sahu

mvp_badge
MVP

Hi Jahnavi,

I think the Search button action flow should include the List Filter System Client Action node with the below mentioned condition

Index(GetAllUsers.Out1.Current.UserName, searchKeyword ,startIndex:,searchFromEnd:False,ignoreCase:True) <> -1


Whatever filtered list you are getting as an output list from the List Filter client action based on the filter condition, showcase the filtered list to the UI grid.


Hope this helps you!


Regards,

Benjith Sam

Hi Jahnavi, 

Are you using ListFilter? Like operator can only be used with queries to filter any records which you can use inside the query itself, you cannot use like operator with ListFilter.

Thanks

Sachin

Your "FetchDataFromYourDatabase" is called GetAllUsers right?

1 - Include into your page search component and define a new localvariable to searchKeyword

2 - on OnChange, create new client action to refresh data

3 - include a filter on your fetch like this

client.userName like "%" + SearchKeyword + "%"


4 - publish and try again

Alexandre de Ribeiro wrote:

Your "FetchDataFromYourDatabase" is called GetAllUsers right?

1 - Include into your page search component and define a new localvariable to searchKeyword

2 - on OnChange, create new client action to refresh data

3 - include a filter on your fetch like this

client.userName like "%" + SearchKeyword + "%"


4 - publish and try again

 

 

I have performed search operation with aggregate and it is successful, Now I am trying with response of external api. After getting response from rest api, I need to perform search operation. But I am not able to perform search operation to consumed rest api response.

Can someone help me in fixing this issue.

Sample1.oml

mvp_badge
MVP

Hi Jahnavi,

Try this flow

Index(UserName, search ,startIndex:,searchFromEnd:False,ignoreCase:True) <> -1

Hope this helps you!


Regards,

Benjith Sam

Sample1.oml

Benjith Sam wrote:

Hi Jahnavi,

Try this flow

Hope this helps you!


Regards,

Benjith Sam

 

 I am getting an empty list when I tried this flow.

mvp_badge
MVP
Solution

Hi Jahnavi,

PFA


Regards,

Benjith Sam

Sample1.oml

Benjith Sam wrote:

Hi Jahnavi,

PFA


Regards,

Benjith Sam

 

 Thank you Benjith Sam, I have achieved my output.

mvp_badge
MVP

Jahnavi Sagi wrote:

 Thank you Benjith Sam, I have achieved my output.

You are welcome, Jahnavi :)

Glad I could be of help!


Regards,

Benjith Sam

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.