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 / Incompatible types err...
Power Apps
Answered

Incompatible types error when using a ForAll loop

(0) ShareShare
ReportReport
Posted on by 317

Hi all,

 

I have a collection "CollectModule" that stores the list of modules of the project selected. If the module is removed from the collection, the status of the module will be updated to "Remove". CSP_S0150_Projects is my SQL table name and both of the collection and the SQL table share the same column names. I'm using a ForAll function to 'loop' through all the record in "CollectModule" to remove it from SQL.

 

From my research, since both of them have the same column names, it seems like I have to use disambiguation operator inside my LookUp. My question is, why is it returning an error when it's working for the situation mentioned here:  https://powerusers.microsoft.com/t5/Building-Power-Apps/Forall-Patch-issue/td-p/568058 ?

 

My error:

NZ0090_0-1685691569830.png

 

My code:

 

 ForAll(
 Filter(CollectModule, Status="Remove"),
 Remove( CSP_S0150_Projects,
 LookUp( CSP_S0150_Projects, CustID=CollectModule[@CustID] && ProjectName=CollectModule[@ProjectName] && Module=CollectModule[@Module]))
)

 

 

Any help or suggestion is hugely appreciated. Thanks!

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

    Hi @NZ0090 ,

     

    Please try this:

     ForAll(
     Filter(CollectModule, Status="Remove") As temp,
     Remove( CSP_S0150_Projects,
     LookUp( CSP_S0150_Projects, CustID=temp.CustID && ProjectName=temp.ProjectName && Module=temp.Module))
    )

     

    Best Regards,

    Wearsky

  • NZ0090 Profile Picture
    317 on at

    @v-xiaochen-msft That seems to be working! Thanks!

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