cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Silias
New Member

Using Variables to choose Column in Gallery

I'm just starting out and I have some trouble with my app. At the start-up I set my "CurUser" variable to my User().Email and substitute the "@" and ".".

Afterwards I am going into a "Detail Gallery" that has a filter set to a specific item ID. Now I want to have  label that displays the Value of my current User (like ThisItem.CurUser) , but I can't get it to work as LookUp just returns the text value and most other things give me an Error.

 

Does anybody have an idea on how to approach this?

4 REPLIES 4
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @Silias ,

If not text value what is the value you want to compare ? 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 ,

 

I indeed want to compare two text values. The name of the Column and my Variable, but for some reason the LookUp and likes Function don't like using a Variable for the Column Name.

Hey! ThisItem.CurUser does not exist.

You have CurUser.Email or CurUser.FullName

 

LookUp(List; Email = CurUser.Email)

 

This will return the item 

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @Silias ,

 

CurUser=User().Email (eg: xyz@email.com)

This is a variable you can print in a lable but if you want this value in a gallery for all the items this will be CurUser.
But In case you want this value to Lookup any value from Gallery collection than you can use below formula

Lookup(DataSource, EmailColumnName=CurUser).ValueRequired

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,934)