web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter a view form bas...
Power Apps
Answered

Filter a view form based on variable

(0) ShareShare
ReportReport
Posted on by 231

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!

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    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 Profile Picture
    231 on at

     

     

    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

     

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    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.

     

  • Frans_365CH Profile Picture
    231 on at

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

     

    companyFilterVar.JPG

  • Sienna Profile Picture
    1,532 on at

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

  • Frans_365CH Profile Picture
    231 on at

    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

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

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

  • Frans_365CH Profile Picture
    231 on at

    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?

  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    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.

  • Frans_365CH Profile Picture
    231 on at

    This works! Not immediately thought of. This is nice, cos you always have different galarys for start. Tasklist, Orderlist. Thank you!

     

    lookup.JPG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard