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.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,912)