How to filter text fields that are empty?

Posted by sorita.d.godfrey@gmail.com on 18-Aug-2017 18:50

I'm trying to fetch records using the rbf_getViewPage API but I can't find a way to filter empty text fields. In the documentation, it was mentioned that we can use NUL opcode in filters to text fields. The error below is displayed whenever this filter is used:

I also tried EQ opCode where the value is an empty string but I'm getting all records instead. I'm using version 4.5.3.

Posted by hmarrout on 20-Aug-2017 23:51

HI

use the value of NUL as a string in the API and give an empty value for Value key

example

rbf_getViewPage("wIk-oviSTMGWo35tznBTUw", function (data) {  }, {

                                          "useLegacyDateFormat": false,

                                          "startRow": 0,

                                          "rowsPerPage": 100,

                                          "fieldList": "Rollnum,Student_name,status,Intrested_subjects",

                                          "filtering":

                                          {

                                              "filters":

                                              [

                                                  {

                                                      "field": "Student_name",

                                                        "value":"",

                                                      "opCode": "NUL"

                                                  }

                                              ]

                                          },

                                          "sorting":

                                          [

                                              {

                                                  "field": "Student_name",

                                                  "order": "asc"

                                              }

                                          ]

                                      });

Thanks and Regards

Hariteja M

All Replies

Posted by hmarrout on 20-Aug-2017 23:41

Hi

The value field for filter must be specified. i.e empty at least

Thanks and Regards

Hariteja M

Posted by hmarrout on 20-Aug-2017 23:51

HI

use the value of NUL as a string in the API and give an empty value for Value key

example

rbf_getViewPage("wIk-oviSTMGWo35tznBTUw", function (data) {  }, {

                                          "useLegacyDateFormat": false,

                                          "startRow": 0,

                                          "rowsPerPage": 100,

                                          "fieldList": "Rollnum,Student_name,status,Intrested_subjects",

                                          "filtering":

                                          {

                                              "filters":

                                              [

                                                  {

                                                      "field": "Student_name",

                                                        "value":"",

                                                      "opCode": "NUL"

                                                  }

                                              ]

                                          },

                                          "sorting":

                                          [

                                              {

                                                  "field": "Student_name",

                                                  "order": "asc"

                                              }

                                          ]

                                      });

Thanks and Regards

Hariteja M

Posted by sorita.d.godfrey@gmail.com on 21-Aug-2017 10:12

Hi Hariteja,

It worked!

Thanks much,

Godfrey

Posted by Shira Taytelbaom on 08-Nov-2017 05:50

Hi,
I'm using the rbf_getViewPage function in order to set a filter to the records I receive,
and it succeeded.
But I want to get the View Page with those received records,
(I want the received data,  to be in the View Page) instead of getting all the records when I bring the View Page of the current object.
Basically my question is, how can I set the received records from the rbf_getViewPage function into the view Page?
Thanks a lot,
Shira

This thread is closed