DHIS 2 API for pulling Period Based on Data Set Name selected

Hello @austin, Thank you for that solution.
I’m developing an App using javascript and once I select a data set, I want to be able to dynamically pull the DataSet Period for data entry as below:
DataEntry

Hope this clarifies my problem.
Remember if one selects a Period that is not mapped according to how it was set, the Data Elements will not be pulled.