cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ciprianpopovici
Frequent Visitor

Default text value based on user logged lookup

 

Hello,

I try to build an app for measuring mileage of cars. People need to add every month number of kilometers in app for specific car.

So i have two list , one call CarNumbers with two columns CarNumber and Driver. Driver it's a people field. In the other list (MileageCars) the drivers need to add number of km for specific car. This contains a text field call CarNumber and number column for kilometers - KmNumber. I want to automatically add the value of car number from list CarNumbers in the text field CarNumber of second list, based o the driver who open the app. All the values are unique , every car have a single driver designated. If it's complicated i can use a text field for email address of driver instead of People field.

 

I try using lookup function on the text field CarNumber from MileageCars but it's not working. Always bring me the first value, no filter..

 

LookUp('CarNumbers',driver.email=User().Email,'CarNumbers.CarNumber)

 

1 ACCEPTED SOLUTION

Accepted Solutions
zmansuri
Super User
Super User

App.OnStart:

Set(varUSer,User());

Set(varCarnum,LookUp(Car Numbers',Lower(driver.Email)=Lower(varUser.Email)).CarNumber)

 

The above code will store the logged in user's car number in the variable. you can use that variable anywhere you want

View solution in original post

4 REPLIES 4
zmansuri
Super User
Super User

App.OnStart:

Set(varUSer,User());

Set(varCarnum,LookUp(Car Numbers',Lower(driver.Email)=Lower(varUser.Email)).CarNumber)

 

The above code will store the logged in user's car number in the variable. you can use that variable anywhere you want

View solution in original post

SqtaMorda
Resolver II
Resolver II


ok i didnt get it right.

 

Thank you very much. It's working.

 

Glad to help

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,291)