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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Relate(), Unrelate() w...
Power Apps
Answered

Relate(), Unrelate() with ComboBox

(0) ShareShare
ReportReport
Posted on by 59

Hey,

 

Little problem, am doing i relate or unrelate with a combobox but it only update one item when i press the update button, what am i doing wrong:

Here is the code on the button - OnSelect

Set(loaderOn, true);
If(
 Radio1.Selected.Value = "Remove",
 ForAll(StoreCombo.SelectedItems, Unrelate(
 MobGallery.Selected.StoreReferentials,
 StoreCombo.Selected
 )
 ),
 ForAll(StoreCombo.SelectedItems, Relate(
 MobGallery.Selected.StoreReferentials,
 StoreCombo.Selected
 )
)
);
Set(loaderOn, false)
Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @LoopinG2023 ,

     

    Maybe you could try:

    Set(loaderOn, true);
    If(
     Radio1.Selected.Value = "Remove",
     ForAll(StoreCombo.SelectedItems, Unrelate(
     MobGallery.Selected.StoreReferentials,
     ThisRecord
     )
     ),
     ForAll(StoreCombo.SelectedItems, Relate(
     MobGallery.Selected.StoreReferentials,
     ThisRecord
     )
    )
    );
    Set(loaderOn, false)

     

    Best regards,

  • LoopinG2023 Profile Picture
    59 on at

    Thanks, and may you know how to relate with a collection?

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @LoopinG2023 ,

     

    It's not possible. Relate function only use for records that already exist in Dataverse tables. But if you can use LookUp function to get related records ForAll the collection, this can be done.

    ForAll(
     ForAll(
     collection,
     LookUp(DVtable, ....)
     ),
     Relate(...)
    )

     

    Best regards,

     

  • LoopinG2023 Profile Picture
    59 on at

    That will not work, my big problem is i have a comboBox when selected it show the items from the relation and i would like to when i unselect its unrelate() but it will only unrelate what is selected

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 413

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
timl Profile Picture

timl 315 Super User 2026 Season 1

Last 30 days Overall leaderboard