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 / Formulas in Collect in...
Power Apps
Answered

Formulas in Collect inside a ForAll loop

(0) ShareShare
ReportReport
Posted on by 7

So I'm trying to nest a formula inside a Collect function to automatically convert one currency to another and I've run into a little bit of a problem. Here's my current ForAll loop:

 

ForAll(Filter(colPodsumowaniePracownika,kategoria = "Zaliczka") As varZal,
 Collect(colPodsumowanieZaliczki,
 {
 ID: varZal.ID,
 kategoria: varZal.kategoria,
 data_wyplaty: varZal.data_wyplaty,
 kurs: varZal.kurs,
 tabela_kursow: varZal.tabela_kursow,
 waluta_krajowa: varZal.waluta_krajowa,
 waluta_obca: varZal.waluta_obca
 }
 )
)

 

But I've wanted to do something like this:

 

ForAll(Filter(colPodsumowaniePracownika,kategoria = "Zaliczka") As varZal,
 Collect(colPodsumowanieZaliczki,
 {
 ID: varZal.ID,
 kategoria: varZal.kategoria,
 data_wyplaty: varZal.data_wyplaty,
 kurs: varZal.kurs,
 tabela_kursow: varZal.tabela_kursow,
 waluta_krajowa: varZal.waluta_krajowa,
 waluta_obca: varZal.waluta_krajowa * varZal.kurs
 }
 )
)

 

So that "waluta_obca" would automatically be calculated depending on "waluta_krajowa" and "kurs".
Any suggestions?

Categories:
I have the same question (0)
  • Verified answer
    Talha_Dar Profile Picture
    870 Super User 2024 Season 1 on at

    Hi @Herbata,

     

    Try the following code and see if it helps.

     

    ForAll(Filter(colPodsumowaniePracownika,kategoria = "Zaliczka") As varZal,
     Collect(colPodsumowanieZaliczki,
     {
     ID: varZal.ID,
     kategoria: varZal.kategoria,
     data_wyplaty: varZal.data_wyplaty,
     kurs: varZal.kurs,
     tabela_kursow: varZal.tabela_kursow,
     waluta_krajowa: varZal.waluta_krajowa,
     waluta_obca: Value(varZal.waluta_krajowa) * Value(varZal.kurs)
     }
     )
    )

     

    If you found my answer helpful, please consider giving it a thumbs-up or a like. Your feedback is greatly appreciated!

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Herbata Profile Picture
    7 on at

    Works great, thank you so much 🙂

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard