cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Auto-populate dropdown depending on Label

Hello, 

 

I have a Dropdown "MonthDropdown" with 'January', 'February', 'March' etc as choices. 

This is linked to a SharePoint choice field with the 12 months as choices. 

 

I would like the dropdown in the PowerApp to default to the month we are currently in.  

 

So far I have created a label called 'TodaysDate' with:

"Text(Now(),DateTimeFormat.LongDateTime24)" - to show the month we are in.

 

And I am hoping to set the dropdowns 'DefaultSelectedItems' to filter: IF Label INCLUDES "July" then set dropdown to "July".

But I can't seem to get the function right. 

 

Any help would be appreciated. 

Thank you.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Hi @Carl1 ,

 

Set this to Default property of the dropdown:

Switch(
    Month(Now()),
    1,
    "JAN",
      2,
    "FEB",
      3,
    "MAR",
      4,
    "APR",
      5,
    "MAY",
      6,
    "JUN",
      7,
    "JUL",
      9,
    "SEP",
      10,
    "OCT",
      11,
    "NOV",
    "DEC"
)


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Highlighted

Hi @Carl1 ,

 

This should work:

Switch(
Month(Now()),
7,
"July")

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

8 REPLIES 8
Highlighted
Super User III
Super User III

Hi @Carl1 ,

 

Set this to Default property of the dropdown:

Switch(
    Month(Now()),
    1,
    "JAN",
      2,
    "FEB",
      3,
    "MAR",
      4,
    "APR",
      5,
    "MAY",
      6,
    "JUN",
      7,
    "JUL",
      9,
    "SEP",
      10,
    "OCT",
      11,
    "NOV",
    "DEC"
)


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Highlighted
Super User III
Super User III

In the default try:

Month(Today ())

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

Hi @KrishnaV , 

 

Thanks for your reply. 

I have copied out your formula and tried a few variations but it doesn't seem to work, here is an example trying this month:

 

Carl1_0-1595512866864.png

 

Highlighted

Hi @Carl1 ,

 

Could you please share with me the items of the dropdown to help you better.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Highlighted

Hi @Carl1 ,

 

Just try with items as below:

["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP"]

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Highlighted

@KrishnaV  Here is the items within the dropdown, that link to the SharePoint Choice field: 

 

Carl1_0-1595513457649.png

 

Highlighted

Hi @Carl1 ,

 

This should work:

Switch(
Month(Now()),
7,
"July")

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Highlighted

@KrishnaV I'm afraid that's what I tried in the screenshot above.

 

Might it be something to do with 'MonthDropdown.SelectedItems.Value' instead of 'month'?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,744)