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!
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.
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
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
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
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
WarrenBelz
146,653
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional