Skip to main content

Notifications

Community site session details

Community site session details

Session Id : BLapeDKf2pedlzHiWtvbN3
Power Apps - Building Power Apps
Unanswered

Labels should appear in gallery based on condition

Like (0) ShareShare
ReportReport
Posted on 16 Sep 2022 07:51:16 by 234

hello everyone,

I am using dataverse tables, In gallery I want labels to appear on below conditions. I have used below expressions for "visible ". when I used below expresion all labels with this expression disappeared. which is wrong action. I tried switch and if condition.

Can any one please guide me?

 

 

/*Switch(
LookUp(
approve,
fruits_1 = ThisItem.fruits,
fruits_1
),
"apple",
true,
"mango",
true,
"orange",
true,
"pinapple",
false,
"cherry",
false,
"others",
false
)*/
If(LookUp(approve,fruits_1=ThisItem.fruits,fruits_1)="apple",true,false)

  • Krishna09 Profile Picture
    234 on 16 Sep 2022 at 10:57:11
    Re: Labels should appear in gallery based on condition

    when I use switch or if . It do not show any error but , whatever the fruits value is, it is taking false as default.(even at conditions of true also)

  • MVP-Phipps Profile Picture
    3,447 Super User 2024 Season 1 on 16 Sep 2022 at 10:31:15
    Re: Labels should appear in gallery based on condition

    The Switch statement I provided will work @Krishna09 

  • Krishna09 Profile Picture
    234 on 16 Sep 2022 at 09:33:30
    Re: Labels should appear in gallery based on condition

    I just now tried thisitem.fruits , with if condition it worked. yesterday it did not work. thanks for @NandiniBhagya20 and @phipps0218  for immediate response. I will try with switch also now. 

  • Krishna09 Profile Picture
    234 on 16 Sep 2022 at 09:30:52
    Re: Labels should appear in gallery based on condition

    fruits_1 is a column name, which is in approve table 

    fruits is another column name, which is in tracker table.

    tracker table is a data source for gallery.

  • MVP-Phipps Profile Picture
    3,447 Super User 2024 Season 1 on 16 Sep 2022 at 09:20:25
    Re: Labels should appear in gallery based on condition

    @Krishna09 your formula is wrong. Try this:

    Switch(
    ThisItem.fruits,
    "apple",
    true,
    "mango",
    true,
    "orange",
    true,
    "pinapple",
    false,
    "cherry",
    false,
    "others",
    false
    )

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • MVP-Phipps Profile Picture
    3,447 Super User 2024 Season 1 on 16 Sep 2022 at 09:20:22
    Re: Labels should appear in gallery based on condition

    @Krishna09 your formula is wrong. Try this:

    Switch(
    ThisItem.fruits,
    "apple",
    true,
    "mango",
    true,
    "orange",
    true,
    "pinapple",
    false,
    "cherry",
    false,
    "others",
    false
    )

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 16 Sep 2022 at 08:59:10
    Re: Labels should appear in gallery based on condition

    Hi,

    Why are you not using ThisItem.fruits directly.

    Fruits column is of which type ?

    Switch(
    ThisItem.fruits,
    "apple",
    true,
    "mango",
    true,
    "orange",
    true,
    "pinapple",
    false,
    "cherry",
    false,
    "others",
    false
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 198 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 108

#3
stampcoin Profile Picture

stampcoin 80

Overall leaderboard