cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lewis1682
Frequent Visitor

Invalid formula. Expected a value compatible with 'DataSource'

Hi all,

 

I am trying to create a edit form, the items for the form are selected from the gallery.

 

I have the following currently:

List = ep_users

gallery = gallery_edit

form = form_edit_user

 

Within the gallery_edit.items I have the following code:

SortByColumns(
  Filter(
    AddColumns(     
      ep_users,
      "PersonsName",
      user_info.DisplayName   
    ),
    StartsWith(user_info.DisplayName, txt_search_edit_screen.Text) Or EndsWith(user_info.DisplayName, txt_search_edit_screen.Text) Or StartsWith(user_info.Email, txt_search_edit_screen.Text)
  ),
  "PersonsName",
  Descending
)

Within the form_edit_user.DataSource I have:

ep_users

Within the form_edit_user.item I have:

gallery_edit.Selected

I am getting the following error under form_edit_user.item 

 

Invalid formula. Expected a value compatible with 'DataSource'

 

Any help on this will be greatly appreciated.

 

Thanks 🙂

1 ACCEPTED SOLUTION

Accepted Solutions

I have managed to find a solution, for the select icon for each item in the gallery, for OnSelect instead of it being Select(parent) (or whatever it defaults to) I have created a variable which is updated whe the icon is pressed to capture the ID, the item field for the form is then set to this variable.

View solution in original post

2 REPLIES 2
samuelJ
Responsive Resident
Responsive Resident

The item() property of a form I believe needs to relate back to the datasource in its DataSource() property.  You should retreive one item from the datasource to populate the form.  So something like the below example:

First(Filter(myDatasource, valueInDB = selectList.Selected.value))

You need to relate some (probably a distinct) value back to a record.  

 

I have managed to find a solution, for the select icon for each item in the gallery, for OnSelect instead of it being Select(parent) (or whatever it defaults to) I have created a variable which is updated whe the icon is pressed to capture the ID, the item field for the form is then set to this variable.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,804)