cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frans_365CH
Level: Powered On

Filter a view form based on variable

from a galary you can navigate to a record in view screen using selected gallary item.

 

item: galary.selected

 

But what if you have more than one galary? 

 

How can i use a var to filter a record in a view form?

 

selectedbyvar.JPG

 

Filter('[Access].[tbl_relaties]';tbl_relatieId=recordId)

 

This does not work.

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Filter a view form based on variable

The Item property of a form is especting a record and the Filter function returns a table. The gallery Items property expects a table and that is why the formula is working there. Try using the Lookup function which returns a record not a table.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

13 REPLIES 13
Anonymous
Not applicable

Re: Filter a view form based on variable

Hi @Frans_365CH

 

It is quite hard to understand what you mean, maybe some pictures could help.

 

You have 1 gallery where you select it and it navigates to a new page with a new gallery which you have to filter based on the first gallery?

 

If yes then your code for Gallery2.Item should be something like this:

 

Filter(
  '[Access].[tbl_relaties]';
  tbl_relatieId=Gallery1.Selected.recordId
)
Frans_365CH
Level: Powered On

Re: Filter a view form based on variable

 

 

list

 

I have this form with a galary:

 

But i have also a task list and a opportunity list, an order list. From all those list i want to navigate to one from. So i can not use the "galary selected function".

 

Hope this will helps?

 

 

view

 

Super User
Super User

Re: Filter a view form based on variable

Have you tried setting a global variable and then using that variable in the Item property of your view form? You would need to updated the OnSelect in the different Galleries to look something like this:

 

Set(gvSelectedGalleryItem, BrowseGallery1.Selected);
Navigate(ViewFormScreen, ScreenTransition.None)

The "BrowseGallery1" name would be different for each gallery but would bring you to the same ViewForm and set the ITem property to the select item in the gallery.

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Frans_365CH
Level: Powered On

Re: Filter a view form based on variable

I did,  but this is not working, get a message that i compare table values with record values....

 

companyFilterVar.JPG

Sienna
Level 10

Re: Filter a view form based on variable

Try add First(...) in your item property

Frans_365CH
Level: Powered On

Re: Filter a view form based on variable

thanks. But this does not work. Why is a var working for a gallary in a form but not a view data form? 

 

companyFilterVarGal.JPG

Super User
Super User

Re: Filter a view form based on variable

What is the error message you get when you hover over the yellow error icon?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Frans_365CH
Level: Powered On

Re: Filter a view form based on variable

The property expected a value of the type record, but these rule pruduece incompatible of type tables.

 

(i have to translate from dutch) but i think this is clear for you?

Highlighted
Super User
Super User

Re: Filter a view form based on variable

The Item property of a form is especting a record and the Filter function returns a table. The gallery Items property expects a table and that is why the formula is working there. Try using the Lookup function which returns a record not a table.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,065)