cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rebeccak
Helper III
Helper III

Parent Gallery show Icon when a new child item is entered

I have posted this question in the past and still haven't figured it out. Please Help

 

I have 2 data sources:

ParentProject

ChildItem, (ProjectID)lookup field to the ParentProject "ID"

 

I am displaying the Parent Gallery whose datasource is ParentProject,and would like an icon to be visible if a new childItem has been entered that matches the "Id". 

 

icon.visible= If( 'ChildItem'.ProjectID = ThisItem.Id, Created<=Today()-7,true,false)

 

It gives me an invalid argument type for the =

My ultimate goal is to visually see an icon presented on the parent gallery item if a child item was created in the last 7 days. 

1 ACCEPTED SOLUTION

Accepted Solutions
R3dKap
Community Champion
Community Champion

All right... So let me summarize all that we've said so far...

 

  1. You have one list called Project and Status that contains a list of projects
  2. You have another list called Project Discussion Points that has a ProjectID lookup column to the Project and Status list so you can store many discussion points on one project
  3. On your app'screen you have a gallery using Project and Status as a datasource
  4. What you want is to show an icon beside each project in the gallery that HAS at least one discussion point and hide it for those who don't have any discussion points at all

 

If that is your exact situation, what I suggest you to do:

  1. Make sure you have your list Project Discussion Points among the datasources available for your app
  2. Set the Visible property of your icon in your gallery to the following formula:

 

Not(IsBlank(LookUp('Project Discussion Points';ProjectID.Id=ThisItem.ID)))

And that should do it... In fact I just tested it on a personal app on which I have the exact same situation as your, except it's about discussion about tickets... 🙂

 

 

 

View solution in original post

8 REPLIES 8
R3dKap
Community Champion
Community Champion

Hi @Rebeccak,

 

First of all I see an error in your OnVisible formula... You forgot the && in your condition:

 

If('ChildItem'.ProjectID = ThisItem.Id && Created<=Today()-7,true,false)

Then, in fact, since the OnVisible property is of type Boolean, you can just write it this way:

 

 

'ChildItem'.ProjectID = ThisItem.Id && Created<=Today()-7

Can you try that already and come back to me if there is still an issue...

 

Also, take a moment to check if the data type for 'ChildItem'.ProjectID matches the one for ThisItem.Id...

I have tried it and the = still has an error of invalid argument type. I checked the value of ProjectID and it is looking up to the Parent List ID. So they should both return a number. 

 

I have also tried 'ChildItems'.ProjectID.Id = ThisItem.ID && Created<=Today()-7

R3dKap
Community Champion
Community Champion

Could you post a capture of the formula (with the error message) in the Icon.Visible property please ?

Here is the screenshot. I have found a complete workaround including Patching and stuff, but this would just work so much easier. 

R3dKap
Community Champion
Community Champion

Ok... What is exactly the data type of the 'Project Discussion Points'.ProjectID column ?

 

Is it a lookup ? A text field ?

 

Right after the ".ProjectID" if you add a dot "." what other properties do you have (can you send a capture please) ?

 

We're getting to it... It's just a bit hard to identify the origin of the problem without having control on the application... 🙂

The 'Project Discussion Points'.ProjectID  column is a lookup column to the Project and Status (Parent) "ID" column.

Sharepoint Column.png

 

If i put a "." next to ProjectID nothing is available to choose from:

ProjectID.png

 

 

R3dKap
Community Champion
Community Champion

All right... So let me summarize all that we've said so far...

 

  1. You have one list called Project and Status that contains a list of projects
  2. You have another list called Project Discussion Points that has a ProjectID lookup column to the Project and Status list so you can store many discussion points on one project
  3. On your app'screen you have a gallery using Project and Status as a datasource
  4. What you want is to show an icon beside each project in the gallery that HAS at least one discussion point and hide it for those who don't have any discussion points at all

 

If that is your exact situation, what I suggest you to do:

  1. Make sure you have your list Project Discussion Points among the datasources available for your app
  2. Set the Visible property of your icon in your gallery to the following formula:

 

Not(IsBlank(LookUp('Project Discussion Points';ProjectID.Id=ThisItem.ID)))

And that should do it... In fact I just tested it on a personal app on which I have the exact same situation as your, except it's about discussion about tickets... 🙂

 

 

 

Thank you Thank You!! I also added the Created>= Today()-7. So i can only see if new ones were added this week. 

Not(IsBlank(LookUp('Project Discussion Points',ProjectID.Id=ThisItem.ID && Created>=Today()-7)))

I truly appreciate your help 🙂

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,703)