web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Select SharePoint choi...
Power Apps
Answered

Select SharePoint choice in dropdown based on value of variable

(0) ShareShare
ReportReport
Posted on by 8

Hello!

 

I have made a PowerApps Canvas app for a shop that sells soap and other stuff for car washers.

It is very simple, and uses a SharePoint list to register the orders.

 

The list includes a column for degreasing, with two choices, "Alkaline" and "Biorol 806". I am displaying these choices in a dropdown list in my powerapp, which works well.

 

Based on todays date, I want to set the degraser automatically, sort of like this:

If(
 varDate >= Date(0,5,1) && varDate <= Date(0,9,1), DegreaserDropDown.Selected = 
 Choices([SPtable].Degraser
)

but I'm not sure how I can actually access the choices from the SharePoint table.

 

To make the question easier, how can I pick a choice in the dropdown by clicking a button. The dropdown expects a record

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Hi @hagru ,

     

    Assuming your using a Form control, you can apply the example below to the Default property of the DataCard (not the DataCardValue).

     

    If(
     'Your Form'.Mode = FormMode.New,
     If(
     varDate >= Date(
     2022,
     1,
     1
     ) && varDate <= Date(
     2024,
     1,
     1
     ),
     {Value: "Alkaline"}
     ),
     ThisItem.Degraser
    )
    
    

     

     

    If not using a Form, apply the below to the DefaultSelectedItems property of your ComboBox.

    If(
     varDate >= Date(
     2022,
     1,
     1
     ) && varDate <= Date(
     2024,
     1,
     1
     ),
     {Value: "Alkaline"}
    )
    

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @hagru ,

     

    If its a combobox then you can use the formula , as below for default and defaultselecteditems property

    If(condition, {Value:"Choice1"},{Value:"Choice2"})

     

    If its a dropdown then you can use the formula without the Value.

    If(condition,Choice1,Choice2)

     

    Hope this helps!

     

    Do give this a thumbs up and mark this as a solution if this solves your issue.

     

    Thanks!

    Sanmesh

  • Hagru Profile Picture
    8 on at

    I was using a Form, and the first suggestion worked very well. Thank you for mentioning that I have to use DataCard, and not the DataCardValue, where I was initially trying to make it work.

     

    Seems like I can put whatever I want into that value, which is fine for now.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard