web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default text value bas...
Power Apps
Answered

Default text value based on user logged lookup

(0) ShareShare
ReportReport
Posted on by 159

 

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)

 

Categories:
I have the same question (0)
  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    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

  • SqtaMorda Profile Picture
    138 on at


    ok i didnt get it right.

     

  • ciprianpopovici Profile Picture
    159 on at

    Thank you very much. It's working.

     

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Glad to help

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard