Hello,
I have a gallery in PowerApps based on a Sharepoint list. I am passing on the item on the gallery to the details screen via Onselect: Set(varcurrentitem,ThisItem)
So, I had a formula for the items in the gallery that was working but did not allow me to search for the owner of the item:
(sorry a bit long. I sort the columns by create date, I have a combobox where users can select by status, and then an input box (Search_Text_Name) to look for text in columns):
SortByColumns(Search(If(IsBlank(ComboBox_Status.Selected.Value),'Experimental Name',Filter('Experimental Name', ComboBox_Status.Selected.Value = Status.Value)),Search_Text_Name.Text,"Site_x0020_Sample_x0020_Reque","Batch_1","Batch_2","Batch_3","Batch_4","INTE_BATCH_NUMBER","SAP_x0020_Order","RDSIMS_x0020_Request","SAP_Order2","SAP_Order3","RDSIMS2","RDSIMS3","Commercial_GMID"),"Created",Descending)
I decided I wanted also to give the users the possibility to search by the Request Owner name, so I have added a column on the fly modifying the formula like this:
SortByColumns(Search(If(IsBlank(ComboBox_Status.Selected.Value),AddColumns('Experimental Name',"Owner",'Created By'.DisplayName),Filter(AddColumns('Experimental Name',"Owner",'Created By'.DisplayName), ComboBox_Status.Selected.Value = Status.Value)),Search_Text_Name.Text,"Site_x0020_Sample_x0020_Reque","Batch_1","Batch_2","Batch_3","Batch_4","INTE_BATCH_NUMBER","SAP_x0020_Order","RDSIMS_x0020_Request","SAP_Order2","SAP_Order3","RDSIMS2","RDSIMS3","Commercial_GMID","Owner"),"Created",Descending)
This is working well for the gallery view, I can now filter by owner, however my surprise was that varcurrentitem (so the variable I am passing via OnSelect to the details screen, = ThisItem) is not working anymore, the details screen tells me "Expected a Value compatible with DataSource".
Can somebody explain me the why this happens, and is there a workaround (other than creating an additional column in the Sharepoint list)? I feel I am missing something...
Thanks a lot!!!!
Kind regards
Valeria