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 / Adding columns to the ...
Power Apps
Answered

Adding columns to the items of a gallery and repercussions on details screen

(0) ShareShare
ReportReport
Posted on by 203

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

 

 

Categories:
I have the same question (0)
  • ValeriaBreve Profile Picture
    203 on at

    Sorry forgot to say - varcurrentitem is set as the "Item" property of the Form in the details screen. This is where I see the error of it not being compatible with the datasource. Thanks!

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @ValeriaBreve ,

     

    Please try this:

    Onselect: Set(varcurrentitem,LookUp('Experimental Name', ID= ThisItem.ID ) )

     

    Best Regards,

    Wearsky

     

  • ValeriaBreve Profile Picture
    203 on at

    Thank you so much. It works wonderfully!!! 🙂

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard