cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MrAutomate
Advocate I
Advocate I

PowerApps Collection - Dups

I have been at this all day and tried numerous solutions and am just stuck..
I have a collection, called MyIndex.  It contains 2 columns, Expense, and Teammate.
A teammate can fill multiple roles in a day on a crew, but for forecasting P&L, the teammate should be counted only once.

I was not able to get the lookup to complete using this example:

ClearCollect(
               NewCollectionA,
               AddColumns(
                           CollectionA,
                           "Price",
                           LookUp(CollectionB, Id = CollectionA[@ID], Price)
               )
)

I have the expense in a sharepoint list called "Teammate Basics"
The collection , MyIndex, has a single column heading, named Result.

ClearCollect(
NewCollectionA,
AddColumns(
MyIndex,
"Cost",
LookUp(TeammateBasics, FirstLast = "MyIndex.Result","DailySalary")
)
)

What am I missing in my lookup, that is not brining in the cost from the TEAMMATE BASICS list when the value matches the collection item MYINDEX.RESULT ?

Or, even better, any new way to group by on a collection and return both columns, without duplications ?
Thanks for any help!

 

 

 

 





1 ACCEPTED SOLUTION

Accepted Solutions
S_Khalifah
New Member

Hi,

 

You should get the value from the collection in a different way, try using :

 

ClearCollect(

NewCollectionA,

AddColumns(

MyIndex,

 

"Cost",

 

LookUp(TeammateBasics, FirstLast = MyIndex.[@Result],"DailySalary")

))

 

Where in your case you are comparing FirstLast with a string value as "MyIndex.Result", this value is between "", which means it will read it as it is, it will not take the value of that item.

View solution in original post

2 REPLIES 2
S_Khalifah
New Member

Hi,

 

You should get the value from the collection in a different way, try using :

 

ClearCollect(

NewCollectionA,

AddColumns(

MyIndex,

 

"Cost",

LookUp(TeammateBasics, FirstLast = MyIndex.[@Result],"DailySalary")

 

)

 

)

 

Where in your case you are comparing FirstLast with a string value as "MyIndex.Result", this value is between "", which means it will read it as it is, it will not take the value of that item.

S_Khalifah
New Member

Hi,

 

You should get the value from the collection in a different way, try using :

 

ClearCollect(

NewCollectionA,

AddColumns(

MyIndex,

 

"Cost",

 

LookUp(TeammateBasics, FirstLast = MyIndex.[@Result],"DailySalary")

))

 

Where in your case you are comparing FirstLast with a string value as "MyIndex.Result", this value is between "", which means it will read it as it is, it will not take the value of that item.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,068)