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 / Possible "LookUp" bug ...
Power Apps
Answered

Possible "LookUp" bug in "ForAll" function for combobox when LookUp and combobox use the same table & same column

(0) ShareShare
ReportReport
Posted on by 28

I have a SQL table "platform" <ID, descriptions>, where ID is an auto-increment value. I set up a combobox in PowerApps using the descriptions as choices. Then I would like to get the selected item ID. The original function I use is 

```

ClearCollect(colPlatform, {var1, platform_ID});

ForAll(combobox.SelectedItems, Collect(colPlatform, {var1: ..., platform_ID: LookUp(platform, descriptions = descriptions, ID)}))

```

The first "descriptions" is the platform table column. The second "descriptions" is the combobox item values. Turns out the ID is always 1 whatever the original ID should be.

To avoid this problem, I created a temporary collection using a different name from "description" to collect item values in combobox, then use the new collection to substitute the function of combobox.SelectedItems to get the correct ID results.

 

May I know if there is a better way to avoid such operation? Is this a bug or if there is something wrong with my previous code?

 

Thank you.

fromage

Categories:
I have the same question (0)
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    Scope management can be difficult with ForAll statements. Try:

    ClearCollect(colPlatform, {var1, platform_ID});
    
    ForAll(combobox.SelectedItems As aItem, 
     Collect(colPlatform, 
     {
     var1: ..., // with the other required entries
     platform_ID: LookUp(platform, descriptions = aItem.descriptions, ID)
     }
     )
    )

    Hope that helps,

    Bryan

  • fromage Profile Picture
    28 on at

    Hi Bryan,

     

    Thank you for the quick response. You are brilliant! This indeed works! I do not know this grammar before.

     

    Thank you! 🙂

    fromgae

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,033

#2
Valantis Profile Picture

Valantis 632

#3
11manish Profile Picture

11manish 607

Last 30 days Overall leaderboard