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 / Relate() with a Galler...
Power Apps
Unanswered

Relate() with a Gallery selected item

(0) ShareShare
ReportReport
Posted on by

Hey everyone,

 

Happy new year!

 

I am having an issue with the Relate() function and galleries. I have a "Demandes" table that has a one-to-many relation with a "Articles" table. In a collection "TempArticles", I have all the articles that I want to connect to a single Demande that is selected via a Gallery called "GalleryForms_1". 

 

Here is the code:

ForAll(
 TempArticles As tempsarticle;
 Relate(
 GalleryForms_1.Selected.Articles;
 LookUp(
 Articles;
 Articles = tempsarticle.Articles
 )
 )
)

 

But this piece of code doesn't work properly... I figured the selection with the gallery doesn't pull the relationship correctly but didn't find any workaround on this (even by using a LookUp() on the "Demandes" table).

 

Thank you for helping me out with this issue. Have a nice day!

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    I did a test for you but I can't reproduce your problem. It worked.

     

    TestL19S ----TestL20S  (Many-----One)

    vxiaochenmsft_0-1641356746497.png

    vxiaochenmsft_1-1641356763312.png

     

    Before:

    vxiaochenmsft_2-1641356784917.png

     

    Add a button control and set its Onselect property to:

    ForAll(
     Col As A,
     Relate(
     Gallery1.Selected.TestL19S,
     LookUp(
     TestL19S,
     TestL19 = A.TestL19
     )
     )
    )
    
    //TestL19 is a guid column.
    

    Select Skill1 record in gallery and click on the relate button.

     

    After:

    vxiaochenmsft_3-1641356865512.png

     

    What did i miss?

     

    Best Regards,

    Wearsky

     

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard