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

Error in detail view (Invalid formula. Expected a value compatible with datasource) where using LookUp in list view gallery

Hi folks

 

Modifying my list view to add a field from a different datasource works in list view but seems to break the detail view (presumably because the datasets no longer match).

 

In ListActionScreen:

GalleryListActions.Items = AddColumns(Actions, "Audit_title", LookUp(Audits, Audit_ref = Actions[@Audit_ref], Title))

NextArrow.OnSelect = Navigate(DetailActionScreen, ScreenTransition.Fade)

 

In DetailActionScreen:

FormViewer.Item = GalleryListActions.Selected

(throws error Invalid forumla. Expected a value compatible with datasource)

 

How should I pass my Selected action to the detail view?

 

Thanks, in advance, for your help.

 

(edited for typo)

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Superelastic ,

Firstly , let the explain where's your problem:

You need to set the form's item to one record in the form's data source.

However, since your form's data source is Actions, your form's Item is actually a record in this tabale: AddColumns(Actions, "Audit_title", LookUp(Audits, Audit_ref = Actions[@Audit_ref], Title)).

These are two different tables.

 

To solve this problem, you need to set the form's data source and item to the same data source.

Try this:
set the form's data source:

AddColumns(Actions, "Audit_title", LookUp(Audits, Audit_ref = Actions[@Audit_ref], Title))

set the form's Item:

GalleryListActions.Selected

//please notice that, in this solution, your form's data source is not the original sharepoint list. So do not use this form to edit or update data. Just use this form to display data.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yutliu-msft
Community Support
Community Support

Hi @Superelastic ,

Firstly , let the explain where's your problem:

You need to set the form's item to one record in the form's data source.

However, since your form's data source is Actions, your form's Item is actually a record in this tabale: AddColumns(Actions, "Audit_title", LookUp(Audits, Audit_ref = Actions[@Audit_ref], Title)).

These are two different tables.

 

To solve this problem, you need to set the form's data source and item to the same data source.

Try this:
set the form's data source:

AddColumns(Actions, "Audit_title", LookUp(Audits, Audit_ref = Actions[@Audit_ref], Title))

set the form's Item:

GalleryListActions.Selected

//please notice that, in this solution, your form's data source is not the original sharepoint list. So do not use this form to edit or update data. Just use this form to display data.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Superelastic
Frequent Visitor

In the end, I just need to copy

 

AddColumns(Actions, "Audit_title", LookUp(Audits, Audit_ref = Actions[@Audit_ref], Title))

 

into the the datasource property of the FormViewer in the DetailActionScreen.

 

 

Thanks for the response.

 

Display is now working fine but I would like to add/edit the underlying SharePoint list.  Can I remove the added column for the edit so it matches the original model?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,540)