cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nico_TW
Helper I
Helper I

Fill in a variable in a function

Hi,

 

i want to access a certain column in a SahrePoint list when a certain user is logged in. 

For Example:

If User().Email = "xxx@domain.com" ; list_xxx

If User().Email = "yyy@domain.com ; list_yyy

 

Is there a way where i can set a variable which checks for the current User().Email and fills in the name of the list.

For Example

If User().Email = "xxx@domain.com ; Set(name ; "xxx")

If User().Email = "yyy@domain.com ; Set(name ; "yyy")

list_name

 

So that i dont repeat the code and if statement.

Im new to coding and would appreciate better ideas but in my mind that would be the easiest solution.

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Nico_TW ,

Unfortunately, you cannot dynamically refer to Power Apps elements such as field names in the context you want to. You would need to hard-code it as you have now.

 

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.

Visit my blog Practical Power Apps

View solution in original post

1 REPLY 1
WarrenBelz
Super User
Super User

Hi @Nico_TW ,

Unfortunately, you cannot dynamically refer to Power Apps elements such as field names in the context you want to. You would need to hard-code it as you have now.

 

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.

Visit my blog Practical Power Apps

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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