Lunar Moon phases dates in Survey123

07-27-2020 05:43 PM
New Contributor III


how can I include the lunar phase when I select the date in the Survey123 form?

Any ideas



0 Kudos
2 Replies
Esri Regular Contributor

Hello Federico Riet Sapriza‌, 

One option would be to use the Survey123 custom JavaScript Pulldata() functions to hit a lunar phases API. 

I have attached a sample that hits a weather API based on a Geopoint location. The sample may be able to be modified in which the survey will pass along a date and the JavaScript function will hit a lunar phases API to return the phase for that date. 

In researching it seems that NOAA has an API that may be able to be used to extract this information. 

Please use these links for reference: 

php - Lunar Phase API - Stack Overflow 

Astronomical Data - NOAA Tides & Currents 

Another option is to potentially use the NOAA information above and create a CSV file with dates and phases for some period of time in the future and use the pulldata() function in your survey to grab those values. 

Thank you, 


Thank you,
New Contributor III

Hi Zach,

thanks so much for your help and input, this most needed by biologist  and other researchers.

The pulldata function option is probably the best, however, I wan't able to find an downloadable excel spreadsheet with this data on the web.

I come across this calculation based on the date that I try to insert into XML Survey123 spreadsheet but without success:

Phase =


link: Moon Phase formula - updated - Expression Help - FACER Community 

 Thanks for the sample that hits a weather API based on a Geopoint location.

Thanks again for you time and aid.



0 Kudos