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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,469)