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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Query and Accum...
Power Apps
Unanswered

How to Query and Accumulate a list from Split string?

(0) ShareShare
ReportReport
Posted on by 38

Hello,

 

I have the following string "A100,A101,A102". What I am trying to do is to split the comma separated string, lookup value on the list (sample below) based on the MatID and accumulate the values into one variable (60 in this example). 

 

So I thought of the following, but that didnt work because editor said i cant use Set inside ForAll. Any ideas? Thanks!

 

ForAll(Split("A100,A101,A102", ","), Set(myAccumulator, myAccumulator + LookUp(myList, matID=Result, MatValue))

 

MatIDMatValue
A10010
A10120
B10030
C10050
A10230
Categories:
I have the same question (0)
  • Verified answer
    John_Martel Profile Picture
    38 on at
    Re: How to Query and Accumulate a list from Split string?

    It turns out it's as simple as adding the Sum function 🙂

     

    Sum(ForAll(Split("A100,A101,A102", ","), LookUp(myList, matID=Result, MatValue)), Value)

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard