cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IMathur
Helper V
Helper V

compare a record value form another sharepoint list and use that in IF function

Hi Folks,

Using the below formula, in gallery item to fill color:

If(Filter(SPList1, ProjectName) = Filter(SPList2, ProjectName) && LookUp(SPList2, ThisItem.DataDeleted = "false", true), RGBA(255, 0, 0, 1), RGBA(141, 198, 63, 1))

 

Gallery is made using SPList1, and sequenced using ProjectName column.

I am not sure, what is going wrong here, please help.

 

4 REPLIES 4
RandyHayes
Super User III
Super User III

@IMathur 

You cannot compare records in PowerApps.  You will need to compare to a column within each record.

However, your formula is actually comparing a table to a table because you are using the Filter function for this, which returns a table.

Is there a specific column you need to compare within each record, or perhaps you are just looking to see if a record exists?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Hi @RandyHayes 

 

Thanks for the reply,

 

Let me explain the scenario:

List 1:

Project Name | Project start Date | Project End Date | Project Status

 

List 2:

Project Name | Data Deleted

 

Gallery uses List 1:

Project 1  , Project 1 status, now i want the red/green dots based on data deleted column from List 2

   

IMathur_0-1620937206355.png

 

 Please let me know if this helps to understand the issue

 

RandyHayes
Super User III
Super User III

@IMathur 

Is Project Name the unique keys between the two lists, or is there some other identity that connects them?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes
Neha
Frequent Visitor

Hi @IMathur , 

 

You can write this formula in the fill property of your circle icon -

If(LookUp(SPList2, ProjectName =ThisItem.ProjectName).DataDeleted = false, red, green)

Here LookUp will help to retrieve the first matching record from list 2 and .DataDeleted will fetch the value of DataDeleted column. ThisItem will get the current Row's record.

You can also store project id column in list 2, it will make sure the data is unique and help you compare IDs in your lookup instead of project name.

 

Thanks,

Neha

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (12,984)