cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lorem1960
Resolver II
Resolver II

Items on DataTable with SortByColumns/Filter/AddColumns seems to be the culprit why I cannot open a selected record?

I have a Screen with a datatable and for the Items for my datatable I have the following:

 

SortByColumns(
Filter(
AddColumns(
'Pending Procurement Receipts',
"StatValue",
Status.Value,
"SentValue",
'Email Sent'.Value
),
(IsBlank(SearchTextBox.Text) ||
StartsWith('PR #',SearchTextBox.Text) ||
StartsWith('Req. Office', SearchTextBox.Text) ||
StartsWith('Title (Title0)', SearchTextBox.Text) ||
StartsWith('Vendor Name', SearchTextBox.Text) ||
StartsWith('Receipt Status', SearchTextBox.Text) ||
StartsWith('Order Contact', SearchTextBox.Text) ||
StartsWith('Receipt Status', SearchTextBox.Text) ||
StartsWith(Response, SearchTextBox.Text) ||
StartsWith(Status.Value, SearchTextBox.Text)
) &&
(drpdwnOrderType.Selected.Result = "All" ||
'Order Type' = drpdwnOrderType.Selected.Result

)

&&
(drpdwnOrderStatus.Selected.Value = "All" ||
Status.Value = drpdwnOrderStatus.Selected.Value

)

&&
(drpdwnEmailSent.Selected.Value = "All" ||
'Email Sent'.Value = drpdwnEmailSent.Selected.Value

)

),

varSortColumn,
varSortDirection

)

 

Everythings works fine when I perform a search, when I perform a sort on all of my columns, in addition, my 3 dropdowns filtering works perfectly as well. But when I select a specific record that in turn should display a FormDetails then that doesn't work.

 

First, for the Action OnSelect for my column PR # I have the following:

 

Set(SelectedRecord,DataTable1.Selected.'PR #');EditForm(FormDetails);Navigate(FormDetails,ScreenTransition.None)

 

For Item on FormDetails I have this:

DataTable1.Selected

But it is complaining with the following: Expected a Value compatible with 'DataSource'.

 

However, when I go back to Items for my DataTable1 and I change it just to 'Pending Procurement Receipts', then when I select record and click on the column PR # the FormDetails opens and is displaying the information as expected. I really have no idea why this doesn't work as expected. Any tips are most welcome.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

okay this works:

 

LookUp('Pending Procurement Receipts','PR #'=DataTable1.Selected.'PR #')

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

@Lorem1960 

For the Item property of the form, use Lookup('Pending Procurement Receipts', ID=Datatable1.Selected.ID)

The reason that Datatable1.Selected does not work is that you have reshaped the original table by adding a column to it so it is no longer identical to the original datasource table and to avoid ambiguity, you will need to be more specific in identifying the correct record. 

okay this works:

 

LookUp('Pending Procurement Receipts','PR #'=DataTable1.Selected.'PR #')

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,789)