Filemaker 17 API “AND” query The Next CEO of Stack OverflowHow do I get a YouTube video thumbnail from the YouTube API?Filemaker: making queries of large data more efficientFilemaker Loose QueryFilemaker PHP API newPerformScriptCommandWhat are the options for passing data to PHP?Execute Script and Return ResultFilemaker XML Query: Using OR?FileMaker PHP API newEditCommand() not found..?Filemaker baseelements FTP change directoryFileMaker 17 Data API missing fieldData

% symbol leads to superlong (forever?) compilations

How do I go from 300 unfinished/half written blog posts, to published posts?

How do I get the green key off the shelf in the Dobby level of Lego Harry Potter 2?

Where to find order of arguments for default functions

How do we know the LHC results are robust?

Visit to the USA with ESTA approved before trip to Iran

How did people program for Consoles with multiple CPUs?

Is a stroke of luck acceptable after a series of unfavorable events?

How to write papers efficiently when English isn't my first language?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Only print output after finding pattern

Is it okay to store user locations?

How to Reset Passwords on Multiple Websites Easily?

What can we do to stop prior company from asking us questions?

How do I solve this limit?

Should I tutor a student who I know has cheated on their homework?

Can a single photon have an energy density?

How can I open an app using Terminal?

Which organization defines CJK Unified Ideographs?

Whats the best way to handle refactoring a big file?

Why were Madagascar and New Zealand discovered so late?

Opposite of a diet

Grabbing quick drinks

Too much space between section and text in a twocolumn document



Filemaker 17 API “AND” query



The Next CEO of Stack OverflowHow do I get a YouTube video thumbnail from the YouTube API?Filemaker: making queries of large data more efficientFilemaker Loose QueryFilemaker PHP API newPerformScriptCommandWhat are the options for passing data to PHP?Execute Script and Return ResultFilemaker XML Query: Using OR?FileMaker PHP API newEditCommand() not found..?Filemaker baseelements FTP change directoryFileMaker 17 Data API missing fieldData










1















I am having a difficult time formulating an "AND" query with the FileMaker 17 API.



Reference:
https://fmhelp.filemaker.com/docs/17/en/dataapi/index.html#perform-a-find-request



This is being passed into CURLOPT_POSTFIELDS.



""query":[
"uniqueID":"fooBar",
"anotherField":1
],"limit":"1""


What I'd like to have happen is that I retrieve 1 record for which the uniqueID is "fooBar" and the anotherField is 1.



However, I get the same record if I pass:



""query":[
"uniqueID":"",
"anotherField":1
],"limit":"1""


So this is doing an "OR" lookup.



How can I structure this request so that it performs an "AND" lookup. In the case of my second example, the query should return no records, as every record in my table has a uniqueID?



Updated post-answer:



In my analysis, it seems that the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record.



For someone coming from MySQL, this is very confusing behavior. And the documentation, while demonstrating this as a global property of FileMaker, is not apparent when looking at the Filemaker API documentation and examples.










share|improve this question




























    1















    I am having a difficult time formulating an "AND" query with the FileMaker 17 API.



    Reference:
    https://fmhelp.filemaker.com/docs/17/en/dataapi/index.html#perform-a-find-request



    This is being passed into CURLOPT_POSTFIELDS.



    ""query":[
    "uniqueID":"fooBar",
    "anotherField":1
    ],"limit":"1""


    What I'd like to have happen is that I retrieve 1 record for which the uniqueID is "fooBar" and the anotherField is 1.



    However, I get the same record if I pass:



    ""query":[
    "uniqueID":"",
    "anotherField":1
    ],"limit":"1""


    So this is doing an "OR" lookup.



    How can I structure this request so that it performs an "AND" lookup. In the case of my second example, the query should return no records, as every record in my table has a uniqueID?



    Updated post-answer:



    In my analysis, it seems that the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record.



    For someone coming from MySQL, this is very confusing behavior. And the documentation, while demonstrating this as a global property of FileMaker, is not apparent when looking at the Filemaker API documentation and examples.










    share|improve this question


























      1












      1








      1








      I am having a difficult time formulating an "AND" query with the FileMaker 17 API.



      Reference:
      https://fmhelp.filemaker.com/docs/17/en/dataapi/index.html#perform-a-find-request



      This is being passed into CURLOPT_POSTFIELDS.



      ""query":[
      "uniqueID":"fooBar",
      "anotherField":1
      ],"limit":"1""


      What I'd like to have happen is that I retrieve 1 record for which the uniqueID is "fooBar" and the anotherField is 1.



      However, I get the same record if I pass:



      ""query":[
      "uniqueID":"",
      "anotherField":1
      ],"limit":"1""


      So this is doing an "OR" lookup.



      How can I structure this request so that it performs an "AND" lookup. In the case of my second example, the query should return no records, as every record in my table has a uniqueID?



      Updated post-answer:



      In my analysis, it seems that the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record.



      For someone coming from MySQL, this is very confusing behavior. And the documentation, while demonstrating this as a global property of FileMaker, is not apparent when looking at the Filemaker API documentation and examples.










      share|improve this question
















      I am having a difficult time formulating an "AND" query with the FileMaker 17 API.



      Reference:
      https://fmhelp.filemaker.com/docs/17/en/dataapi/index.html#perform-a-find-request



      This is being passed into CURLOPT_POSTFIELDS.



      ""query":[
      "uniqueID":"fooBar",
      "anotherField":1
      ],"limit":"1""


      What I'd like to have happen is that I retrieve 1 record for which the uniqueID is "fooBar" and the anotherField is 1.



      However, I get the same record if I pass:



      ""query":[
      "uniqueID":"",
      "anotherField":1
      ],"limit":"1""


      So this is doing an "OR" lookup.



      How can I structure this request so that it performs an "AND" lookup. In the case of my second example, the query should return no records, as every record in my table has a uniqueID?



      Updated post-answer:



      In my analysis, it seems that the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record.



      For someone coming from MySQL, this is very confusing behavior. And the documentation, while demonstrating this as a global property of FileMaker, is not apparent when looking at the Filemaker API documentation and examples.







      curl filemaker






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 18:45







      jhchnc

















      asked Mar 5 at 22:37









      jhchncjhchnc

      6111




      6111






















          3 Answers
          3






          active

          oldest

          votes


















          1














          You are doing an "AND" find. If a field is empty in a find then it will not be searched on. In your counter example you were only searching for fields with anotherField:1. If you want to search on an empty field use "=" as it will only find empty words.



          Not enough Rep to comment but for your previous answer:



          For Filemaker finds on a uniqueID you would want to use "==" . "=" will give you a word match while "==" will give you an exact value match. See https://fmhelp.filemaker.com/help/12/fmp/en/html/find_sort.5.6.html






          share|improve this answer

























          • That's true, but it's a comment on my answer, not the answer to solving "AND" vs "OR"

            – jhchnc
            Mar 8 at 14:41











          • Oh sorry I didn't have another rep to comment. Updated

            – Rushfire
            Mar 8 at 15:08







          • 1





            Updated for AND vs OR answer.

            – Rushfire
            Mar 8 at 15:29











          • Accepted your answer!

            – jhchnc
            Mar 8 at 18:40











          • The use-case related to my second example, and hence the question, is if you are passing a value which is empty or null. The right thing to do is error checking and validation of variables, but I still label this odd behavior from a modern DB perspective.... I appreciate your answer!

            – jhchnc
            Mar 8 at 18:47


















          1














          Agreed re: the Data API documentation. To clarify, for folks who may be visiting this thread later:



          // this AND that, array with single predicate object

          "query": [
          "this": "foo",
          "that": "bar"
          ]


          // this OR that, array with multiple predicate objects

          "query": [
          "this": "foo",
          "that": "bar"
          ]





          share|improve this answer

























          • Really helpful, thank you.

            – jhchnc
            Mar 18 at 14:49


















          0














          I know I literally ask this a moment ago, but it bears recording, as the Filemaker API documentation is pretty shoddy.



          ""query":[
          "uniqueID":"=fooBar",
          "anotherField":1
          ],"limit":"1""


          That returns the record I seek.



          The addition of either = == prevents the false positive, albeit in different ways.



          -- Updated to reflect the fine-grained details in Rushfire's answer.






          share|improve this answer




















          • 2





            All queries in your question and in your answer are AND queries, so your answer is incorrect

            – Nicolai Kant
            Mar 8 at 15:27











          • I agree that that is technically true, but the documentation is fairly poor. Technically, the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record. For someone coming from MySQL, this is very confusing behavior.

            – jhchnc
            Mar 8 at 18:42











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55012727%2ffilemaker-17-api-and-query%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You are doing an "AND" find. If a field is empty in a find then it will not be searched on. In your counter example you were only searching for fields with anotherField:1. If you want to search on an empty field use "=" as it will only find empty words.



          Not enough Rep to comment but for your previous answer:



          For Filemaker finds on a uniqueID you would want to use "==" . "=" will give you a word match while "==" will give you an exact value match. See https://fmhelp.filemaker.com/help/12/fmp/en/html/find_sort.5.6.html






          share|improve this answer

























          • That's true, but it's a comment on my answer, not the answer to solving "AND" vs "OR"

            – jhchnc
            Mar 8 at 14:41











          • Oh sorry I didn't have another rep to comment. Updated

            – Rushfire
            Mar 8 at 15:08







          • 1





            Updated for AND vs OR answer.

            – Rushfire
            Mar 8 at 15:29











          • Accepted your answer!

            – jhchnc
            Mar 8 at 18:40











          • The use-case related to my second example, and hence the question, is if you are passing a value which is empty or null. The right thing to do is error checking and validation of variables, but I still label this odd behavior from a modern DB perspective.... I appreciate your answer!

            – jhchnc
            Mar 8 at 18:47















          1














          You are doing an "AND" find. If a field is empty in a find then it will not be searched on. In your counter example you were only searching for fields with anotherField:1. If you want to search on an empty field use "=" as it will only find empty words.



          Not enough Rep to comment but for your previous answer:



          For Filemaker finds on a uniqueID you would want to use "==" . "=" will give you a word match while "==" will give you an exact value match. See https://fmhelp.filemaker.com/help/12/fmp/en/html/find_sort.5.6.html






          share|improve this answer

























          • That's true, but it's a comment on my answer, not the answer to solving "AND" vs "OR"

            – jhchnc
            Mar 8 at 14:41











          • Oh sorry I didn't have another rep to comment. Updated

            – Rushfire
            Mar 8 at 15:08







          • 1





            Updated for AND vs OR answer.

            – Rushfire
            Mar 8 at 15:29











          • Accepted your answer!

            – jhchnc
            Mar 8 at 18:40











          • The use-case related to my second example, and hence the question, is if you are passing a value which is empty or null. The right thing to do is error checking and validation of variables, but I still label this odd behavior from a modern DB perspective.... I appreciate your answer!

            – jhchnc
            Mar 8 at 18:47













          1












          1








          1







          You are doing an "AND" find. If a field is empty in a find then it will not be searched on. In your counter example you were only searching for fields with anotherField:1. If you want to search on an empty field use "=" as it will only find empty words.



          Not enough Rep to comment but for your previous answer:



          For Filemaker finds on a uniqueID you would want to use "==" . "=" will give you a word match while "==" will give you an exact value match. See https://fmhelp.filemaker.com/help/12/fmp/en/html/find_sort.5.6.html






          share|improve this answer















          You are doing an "AND" find. If a field is empty in a find then it will not be searched on. In your counter example you were only searching for fields with anotherField:1. If you want to search on an empty field use "=" as it will only find empty words.



          Not enough Rep to comment but for your previous answer:



          For Filemaker finds on a uniqueID you would want to use "==" . "=" will give you a word match while "==" will give you an exact value match. See https://fmhelp.filemaker.com/help/12/fmp/en/html/find_sort.5.6.html







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 8 at 15:27

























          answered Mar 7 at 16:43









          RushfireRushfire

          563




          563












          • That's true, but it's a comment on my answer, not the answer to solving "AND" vs "OR"

            – jhchnc
            Mar 8 at 14:41











          • Oh sorry I didn't have another rep to comment. Updated

            – Rushfire
            Mar 8 at 15:08







          • 1





            Updated for AND vs OR answer.

            – Rushfire
            Mar 8 at 15:29











          • Accepted your answer!

            – jhchnc
            Mar 8 at 18:40











          • The use-case related to my second example, and hence the question, is if you are passing a value which is empty or null. The right thing to do is error checking and validation of variables, but I still label this odd behavior from a modern DB perspective.... I appreciate your answer!

            – jhchnc
            Mar 8 at 18:47

















          • That's true, but it's a comment on my answer, not the answer to solving "AND" vs "OR"

            – jhchnc
            Mar 8 at 14:41











          • Oh sorry I didn't have another rep to comment. Updated

            – Rushfire
            Mar 8 at 15:08







          • 1





            Updated for AND vs OR answer.

            – Rushfire
            Mar 8 at 15:29











          • Accepted your answer!

            – jhchnc
            Mar 8 at 18:40











          • The use-case related to my second example, and hence the question, is if you are passing a value which is empty or null. The right thing to do is error checking and validation of variables, but I still label this odd behavior from a modern DB perspective.... I appreciate your answer!

            – jhchnc
            Mar 8 at 18:47
















          That's true, but it's a comment on my answer, not the answer to solving "AND" vs "OR"

          – jhchnc
          Mar 8 at 14:41





          That's true, but it's a comment on my answer, not the answer to solving "AND" vs "OR"

          – jhchnc
          Mar 8 at 14:41













          Oh sorry I didn't have another rep to comment. Updated

          – Rushfire
          Mar 8 at 15:08






          Oh sorry I didn't have another rep to comment. Updated

          – Rushfire
          Mar 8 at 15:08





          1




          1





          Updated for AND vs OR answer.

          – Rushfire
          Mar 8 at 15:29





          Updated for AND vs OR answer.

          – Rushfire
          Mar 8 at 15:29













          Accepted your answer!

          – jhchnc
          Mar 8 at 18:40





          Accepted your answer!

          – jhchnc
          Mar 8 at 18:40













          The use-case related to my second example, and hence the question, is if you are passing a value which is empty or null. The right thing to do is error checking and validation of variables, but I still label this odd behavior from a modern DB perspective.... I appreciate your answer!

          – jhchnc
          Mar 8 at 18:47





          The use-case related to my second example, and hence the question, is if you are passing a value which is empty or null. The right thing to do is error checking and validation of variables, but I still label this odd behavior from a modern DB perspective.... I appreciate your answer!

          – jhchnc
          Mar 8 at 18:47













          1














          Agreed re: the Data API documentation. To clarify, for folks who may be visiting this thread later:



          // this AND that, array with single predicate object

          "query": [
          "this": "foo",
          "that": "bar"
          ]


          // this OR that, array with multiple predicate objects

          "query": [
          "this": "foo",
          "that": "bar"
          ]





          share|improve this answer

























          • Really helpful, thank you.

            – jhchnc
            Mar 18 at 14:49















          1














          Agreed re: the Data API documentation. To clarify, for folks who may be visiting this thread later:



          // this AND that, array with single predicate object

          "query": [
          "this": "foo",
          "that": "bar"
          ]


          // this OR that, array with multiple predicate objects

          "query": [
          "this": "foo",
          "that": "bar"
          ]





          share|improve this answer

























          • Really helpful, thank you.

            – jhchnc
            Mar 18 at 14:49













          1












          1








          1







          Agreed re: the Data API documentation. To clarify, for folks who may be visiting this thread later:



          // this AND that, array with single predicate object

          "query": [
          "this": "foo",
          "that": "bar"
          ]


          // this OR that, array with multiple predicate objects

          "query": [
          "this": "foo",
          "that": "bar"
          ]





          share|improve this answer















          Agreed re: the Data API documentation. To clarify, for folks who may be visiting this thread later:



          // this AND that, array with single predicate object

          "query": [
          "this": "foo",
          "that": "bar"
          ]


          // this OR that, array with multiple predicate objects

          "query": [
          "this": "foo",
          "that": "bar"
          ]






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 21 at 4:23

























          answered Mar 15 at 3:31









          Brian HammBrian Hamm

          20615




          20615












          • Really helpful, thank you.

            – jhchnc
            Mar 18 at 14:49

















          • Really helpful, thank you.

            – jhchnc
            Mar 18 at 14:49
















          Really helpful, thank you.

          – jhchnc
          Mar 18 at 14:49





          Really helpful, thank you.

          – jhchnc
          Mar 18 at 14:49











          0














          I know I literally ask this a moment ago, but it bears recording, as the Filemaker API documentation is pretty shoddy.



          ""query":[
          "uniqueID":"=fooBar",
          "anotherField":1
          ],"limit":"1""


          That returns the record I seek.



          The addition of either = == prevents the false positive, albeit in different ways.



          -- Updated to reflect the fine-grained details in Rushfire's answer.






          share|improve this answer




















          • 2





            All queries in your question and in your answer are AND queries, so your answer is incorrect

            – Nicolai Kant
            Mar 8 at 15:27











          • I agree that that is technically true, but the documentation is fairly poor. Technically, the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record. For someone coming from MySQL, this is very confusing behavior.

            – jhchnc
            Mar 8 at 18:42















          0














          I know I literally ask this a moment ago, but it bears recording, as the Filemaker API documentation is pretty shoddy.



          ""query":[
          "uniqueID":"=fooBar",
          "anotherField":1
          ],"limit":"1""


          That returns the record I seek.



          The addition of either = == prevents the false positive, albeit in different ways.



          -- Updated to reflect the fine-grained details in Rushfire's answer.






          share|improve this answer




















          • 2





            All queries in your question and in your answer are AND queries, so your answer is incorrect

            – Nicolai Kant
            Mar 8 at 15:27











          • I agree that that is technically true, but the documentation is fairly poor. Technically, the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record. For someone coming from MySQL, this is very confusing behavior.

            – jhchnc
            Mar 8 at 18:42













          0












          0








          0







          I know I literally ask this a moment ago, but it bears recording, as the Filemaker API documentation is pretty shoddy.



          ""query":[
          "uniqueID":"=fooBar",
          "anotherField":1
          ],"limit":"1""


          That returns the record I seek.



          The addition of either = == prevents the false positive, albeit in different ways.



          -- Updated to reflect the fine-grained details in Rushfire's answer.






          share|improve this answer















          I know I literally ask this a moment ago, but it bears recording, as the Filemaker API documentation is pretty shoddy.



          ""query":[
          "uniqueID":"=fooBar",
          "anotherField":1
          ],"limit":"1""


          That returns the record I seek.



          The addition of either = == prevents the false positive, albeit in different ways.



          -- Updated to reflect the fine-grained details in Rushfire's answer.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 8 at 14:43

























          answered Mar 5 at 22:43









          jhchncjhchnc

          6111




          6111







          • 2





            All queries in your question and in your answer are AND queries, so your answer is incorrect

            – Nicolai Kant
            Mar 8 at 15:27











          • I agree that that is technically true, but the documentation is fairly poor. Technically, the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record. For someone coming from MySQL, this is very confusing behavior.

            – jhchnc
            Mar 8 at 18:42












          • 2





            All queries in your question and in your answer are AND queries, so your answer is incorrect

            – Nicolai Kant
            Mar 8 at 15:27











          • I agree that that is technically true, but the documentation is fairly poor. Technically, the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record. For someone coming from MySQL, this is very confusing behavior.

            – jhchnc
            Mar 8 at 18:42







          2




          2





          All queries in your question and in your answer are AND queries, so your answer is incorrect

          – Nicolai Kant
          Mar 8 at 15:27





          All queries in your question and in your answer are AND queries, so your answer is incorrect

          – Nicolai Kant
          Mar 8 at 15:27













          I agree that that is technically true, but the documentation is fairly poor. Technically, the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record. For someone coming from MySQL, this is very confusing behavior.

          – jhchnc
          Mar 8 at 18:42





          I agree that that is technically true, but the documentation is fairly poor. Technically, the second query in my question simply is an AND for any uniqueID which contains literally nothing, which I guess Filemaker somehow interprets as being true for any record. For someone coming from MySQL, this is very confusing behavior.

          – jhchnc
          Mar 8 at 18:42

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55012727%2ffilemaker-17-api-and-query%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко