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

Welcome to the User Group Public Preview

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

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (66,321)