Answers.Body: <p>Not sure what you mean by "custom" relative date filter, but if you're looking for filtering the results just like we have on the "Find Participant" form, then yes, looks like it is possible. </p>
  
  <p>Eg - To find all participants registered in this fiscal year can be retrieved via -</p>
  
  <p><a href="https://i.sstatic.net/4SJT1.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4SJT1.png" alt="enter image description here"></a></p>
  
  <p>i.e, select <code>Other</code> in the Parameter dropdown and enter <code>participant_register_date_relative</code> in the textbox as shown above.</p>
  
  <p>The API that will be formed is -</p>
  
  <pre><code>$result = civicrm_api3('Participant', 'get', [
    'sequential' =&gt; 1,
    'participant_register_date_relative' =&gt; "this.fiscal_year",
  ]);
  </code></pre>
  
  <p>Similarly, for Previous Fiscal Year, enter <code>previous.fiscal_year</code> in the value field.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-26T07:12:57.977Z
Answers.Text: By custom I mean for core & custom date fields. Would this also work for other core date fields and custom date fields? Further: what would be the best place in the dev api section to document this?
Answers.UserDisplayName: Richard van Oosterhout
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-25T06:20:12.737Z
Answers.LastActivityDate: 2019-08-25T06:20:12.737Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>I was wondering if it is possible to use (custom) relative date filters with the api?</p>
  
  <p>For instance to find all participants of events in the current or last fiscal year.</p>
  
  <p>Would save me a lot of trouble :-) Thanks fort thinking along!</p>
  
Tags: <api>
Title: Relative date filter possible in api?
ThreadText: # Relative date filter possible in api?
  
  (Asked by: username_0 on 2019-08-24)
  
  I was wondering if it is possible to use (custom) relative date filters with the api?
  
  For instance to find all participants of events in the current or last fiscal year.
  
  Would save me a lot of trouble :-) Thanks fort thinking along!
  
  **Tags:** api
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-25. Score: 3
  
  Not sure what you mean by "custom" relative date filter, but if you're looking for filtering the results just like we have on the "Find Participant" form, then yes, looks like it is possible.
  
  Eg - To find all participants registered in this fiscal year can be retrieved via -
  
  [![enter image description here](https://i.sstatic.net/4SJT1.png)](https://i.sstatic.net/4SJT1.png)
  
  i.e, select `Other` in the Parameter dropdown and enter `participant_register_date_relative` in the textbox as shown above.
  
  The API that will be formed is -
  
  ```
  $result = civicrm_api3('Participant', 'get', [
    'sequential' => 1,
    'participant_register_date_relative' => "this.fiscal_year",
  ]);
  
  ```
  
  Similarly, for Previous Fiscal Year, enter `previous.fiscal_year` in the value field.
  
  > **Comments:**
  > **username_0**: By custom I mean for core & custom date fields. Would this also work for other core date fields and custom date fields? Further: what would be the best place in the dev api section to document this?  
  
  ---
  
  