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

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
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)
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.

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
) 
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?

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

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,235)