cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Conditional visibility question

Hi

I have a gallery that I'm trying to conditionally show or hide a picture on. The condition is that and item is present in a sharepoint list and that the created date is today. The only thing Powerapps seems to dislike about my formula is the = sign, which gets the invalid argument type warning. Can anyone help me with fixing the formula please?

 

If('Customer RAG Data'.Title = ThisItem.Title && 'Customer RAG Data'.Created = Today(),true,false)

What I'm trying to acheive is to have a tick graphic appear when a report regarding the customer identified by the title has been submitted but only for today, so the tick will not be present tomorrow, but will reappear when another report is submitted tomorrow. 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I think the issue is that Created column is DateTime (storing the date and time) while Today() is only date.

 

I did a test and was able to return true values using this (basically convert Created column into text and then convert back into just date) :

If(
    DateValue(
        Text(
            LookUp(
                'Customer RAG Data',
                Title = ThisItem.Title,
                Created
            )
        )
    ) = Today(),
    true,
    false
)

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous

 

If you have this in the gallery you do not need to call the list name again.

 

Simply this should work:

If(ThisItem.Created = Today(),true,false)
Anonymous
Not applicable

Sadly the gallery calls the items from a different sharepoint list than the reports list. The format is

Customer list (from which the gallery items are pulled)

 

Customer Reports list (which is where the reports that are created on a form on another screen are submitted to)

 

So the items in the gallery are not the items in the report. Any help on how to progress would be gratefully received.

Anonymous
Not applicable

Alright. Then maybe this would work:

 

If(
  LookUp('Customer RAG Data',Title = ThisItem.Title,Created) = Today(),
  true,
  false
) 
Anonymous
Not applicable

That generates no errors, but it doesn't show the image when there are reports in the Customer RAG Data list for today for the customer with that name. Can you walk me through what that formula does and perhaps we could troubleshoot it together if I undertand how it works?

Anonymous
Not applicable

I think the issue is that Created column is DateTime (storing the date and time) while Today() is only date.

 

I did a test and was able to return true values using this (basically convert Created column into text and then convert back into just date) :

If(
    DateValue(
        Text(
            LookUp(
                'Customer RAG Data',
                Title = ThisItem.Title,
                Created
            )
        )
    ) = Today(),
    true,
    false
)

 

View solution in original post

Anonymous
Not applicable

You are a total genius! Thanks so much!!
I suspected the date format might be an issue. I've already solved a similar issue myself today whereby Sharepoint handles names as lastname, firstname and Powerapps is in firstname lastname, but I was totally stumped on this one. Thanks again! 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

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,980)