In this Power Apps tutorial, we will look at how to get the month name from a date using the Datepicker control in Power Apps. how to get month name from date in power apps
In Power Apps, get the month name from the date
Here, we’ll look at how to use Power Apps Datepicker to get the month name from a date. Let’s start with this.
When a user selects a particular day from the date picker control, the month name will be generated from that date.
For instance, when I set the Join Date as 02/02/2022, the month of February was retrieved as shown below.
Now, follow the guidelines below to do this.
The Power Apps form fields are taken from the SharePoint list, therefore the screenshot below shows the list of columns in the SharePoint database. like as
- Name – Text
- Phone – Number
- Admission – Date and Time
- Course – Choice
- Make a blank canvas app in the Power Apps environment.
- Add a Power Apps edit form to that canvas app.
- Connect that edit form’s data source to the relevant SharePoint list. As shown below, all of the fields will be retrieved from the SharePoint list and used to edit the form.
Additionally, as seen below, we can see that the Admission Date DataCard will come with a date picker control: (We’ve chosen a day using the Admission Date picker option.)
We must extract the month’s name from the chosen date in following the instructions. Accordingly, if the user chooses the date “02/09/2023,” the label control will show the name “February” for the month.
The following steps are required for this:
- To modify the properties, choose the Join Date Data Card inside the edit form and unlock it.
- Place a label control under the date picker control inside the DataCard.
To display the name of the month starting from the specified date, add the formula below to the label’s Text property.
“The Admission month is ” & Text(DataCardValue3.SelectedDate, “[$-en-US]mmmm”)
Let’s preview the application, choose a date from the date picker control (for example, 3/15/2023), and complete all the fields (optional). As shown below, it will display the relevant month (in this case, March):
this is how we get the month name from a date using the Datepicker control in Power Apps.