Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • LoopinG2023 Profile Picture
    59 on at
    Re: Relate(), Unrelate() with ComboBox

    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

  • v-jefferni Profile Picture
    on at
    Re: Relate(), Unrelate() with ComboBox

    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
    Re: Relate(), Unrelate() with ComboBox

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

  • Verified answer
    v-jefferni Profile Picture
    on at
    Re: Relate(), Unrelate() with ComboBox

    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,

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard