Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Dropdown Default Value to Show DataCard Current Value

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

Hopefully this is an easy one... I have a form that is displaying the results from searching a sharepoint list. I have a dropdown on a separate screen that I want to show what the current value of the datacard is when they have done a search. The dropdown has a list of options already for the user to be able to change what is currently selected to something different so I want to set the Default code to show what is currently selected in the sharepoint list but keep the Items code to have the list of options. Is this possible? 

 

The datacard is named Status_DataCard

The form the datacard is in is named Form2_2

The dropdown is named Dropdown-Status_1

 

Hopefully that made sense

 

Thanks in advance! 

  • WarrenBelz Profile Picture
    146,653 Most Valuable Professional on at
    Re: Dropdown Default Value to Show DataCard Current Value

    Hi @Dave-ITMan ,

    I am finding it hard to visualise all of that completely, but you are correct that 'Created By' is read-only. I am offline for a while now.

  • Dave-ITMan Profile Picture
    on at
    Re: Dropdown Default Value to Show DataCard Current Value

    Hi @WarrenBelz 

    I don't think that will work in my scenario. Below is what I've got:

     

    A screen that has the search ability to search the sharepoint list for specific records using the ID field from the sharepoint list. When the user finds the record they need to update, they go to another screen (screen2) that has all the drop downs, text boxes etc pre populated with what's displayed in each field from the sharepoint list record. They can then change that to what they need it to be. There's another screen that's hidden from the user, which has a form on it to show all the information from the sharepoint list for each column, screen2 then looks at this form to pull the information using the Default property with code similar to Status_DataCard.Default which has worked for all of the boxes (about 15), except the Author column in SharePoint which i've named the column Created By. On the form, the Created By field is named Created By_DataCard so using the same code as everything else, I used 'Created By_DataCard'.Default which doesn't work. If I change it to 'Created By_DataCard'.DataField then it returns the result Author which is what field it is but I just can't seem to get the value. If I click on the field in the form and go to Default for Created By then it does have in it what you said... ThisItem.'Created By' so i've tried going to my other screen where all the drop downs etc are and putting what you said... 

    ThisItem.'Created By'.DisplayName

    but it still doesn't work. The field is set to a read field and not an edit field, would that have anything to do with it? 

     

    Many thanks

  • WarrenBelz Profile Picture
    146,653 Most Valuable Professional on at
    Re: Dropdown Default Value to Show DataCard Current Value

    Hi @Dave-ITMan ,

    In my earlier response, I assumed that what is currently selected referred to a gallery. Are you referring to the current value stored in the field in the data source - if so, there is a better way of doing this by simply using 

    ThisItem.Status

    If this is what you are after then in the 'Created By' item, you need

    ThisItem.'Created By'.DisplayName

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Dave-ITMan Profile Picture
    on at
    Re: Dropdown Default Value to Show DataCard Current Value

    Hi @WarrenBelz 

     

    Thanks for the quick response, that didn't work but i've managed to sort most of them by doing Status_DataCard.Default, the only one that doesn't seem to be working is the created by field, this is the one that sharepoint automatically creates as a field and shows you which user submitted the powerapp. I've got the below

     

    Field in the Edit Form:

    Created By_DataCard

     

    My code on the Default property i've tried is

    'Created By_DataCard'.Default

     

    Many thanks

  • WarrenBelz Profile Picture
    146,653 Most Valuable Professional on at
    Re: Dropdown Default Value to Show DataCard Current Value

    Hi @Dave-ITMan ,

    I assume this is a drop-down (not a Combo Box), so the property you need is the Default. This simply needs to be 

    GalleryName.Selected.FieldName

    but you also need to ensure that this value is in the schema (available for choice) of the drop-down Items.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,653 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard