cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Robertjde
Helper V
Helper V

If Funktion

i have two galleries. Gallery 7 is controlled via a dropdown box and the date displayed (type date) should then be hidden in the 2nd gallery.
My attempt so far has been ...

 

Visible Button

 

If(ThisItem.Datum = Gallery7.AllItems.Datum;false;true)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Robertjde ,

That is way beyond the question you asked

If(ThisItem.Datum = Gallery7.AllItems.Datum;false;true)

(which is what I responded to), but glad you got it working.

View solution in original post

12 REPLIES 12
WarrenBelz
Super User
Super User

Hi @Robertjde ,

I am assuming here it should be hidden if the dates match in the two galleries - you need this

Text(ThisItem.Datum,ShortDate) <> Text(Gallery7.Selected.Datum,ShortDate)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz Thank you for your answer! Unfortunately that doesn't work.

 

Yes, the button should be hidden.
To explain, I have a booking app and would like to hide the button for booking a specific day on public holidays.

I've tried several different approaches.
gallery 7 is filtered by month and then shows all holidays in that month. Display day, month is written out, year, date completed.
In both galleries, the label is Text Type Date


Feiertage.JPG

Hi @Robertjde ,

I am not sure how that helps me solve this for you. What two elements have to match for the Visible property of the control to be false, where are they referenced and please confirm they are both dat fields/values. I am after the underlying field in the gallery.

@WarrenBelz 
Gallery 7 = Subtitle1 (Date value)
Gallery 1 = Subtitle1_1 (Date value)

the visible property of "Button_Tag" (gallery 1) should be set to false.

Sorry for informing you badly.




 

@Robertjde ,

I need the underlying field name - what is in the Text of Subtitle1 and Subtitle1_1 ?

@WarrenBelz 
Gallery 7 Items
: Filter('Feiertage Berlin';Monat = drp_Monate.Selected.GeschrMonat; Title = drp_Jahre.Selected.Value)
Subtitle1 Text: ThisItem.Datum (Date value)


Gallery 1 Items:FirstN(colTage;varAnzahlTage)
Subtitle1_1 Text
: ThisItem.Datum (Date value)

 

In Gallery 1 "Button_Tag" should go false if they match 😅

Hi @Robertjde ,

Getting back to basics here - put two labels on the screen with 

Gallery7.Selected.Datum

and 

Gallery1.Selected.Datum

Do you see the same value in both of them when you think the button should not show?

@WarrenBelz 
No, I don't see a date in the two new labels. So does that mean I have to select them or how do I best do that?

Hi @Robertjde ,

We have found the reason the formula is not working anyway.

Yes - they would need to be selected - that is the only way you can refer to their value.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,602)