cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Anonymous
Not applicable

Re: Conditional visibility question

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
Highlighted
Anonymous
Not applicable

Re: Conditional visibility question

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)
Highlighted
Anonymous
Not applicable

Re: Conditional visibility question

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.

Highlighted
Anonymous
Not applicable

Re: Conditional visibility question

Alright. Then maybe this would work:

 

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

Re: Conditional visibility question

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?

Highlighted
Anonymous
Not applicable

Re: Conditional visibility question

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

Highlighted
Anonymous
Not applicable

Re: Conditional visibility question

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,478)