Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Model Driven App Command Button To Post Look Up Value To Text Field

(1) ShareShare
ReportReport
Posted on by 10
I am creating a model driven power app. In the app, I have an investment form over the investment table. 
On the investment form I have a field called reviewer 1 which is a look up field using the Role table to 
get the Reviewer 1 name. I also have a field called reviewer 2 which is a single line of text field on the 
investment form. On the Investment form I have a command button called Approve. When the user clicks the 
approve command button, I would like the value of the reviewer 1 look up to be posted to the reviewer 2 text field. 
What is the best way to accomplish this?  I have not been able to come up with any Power Fx code that 
avoids triggering an error. 
  • Suggested answer
    JS-29072031-0 Profile Picture
    10 on at
    Model Driven App Command Button To Post Look Up Value To Text Field
    Jonathan, Thank you very much for your answer.  It led me to the solution that worked for me.  Specifically, here is what I ended up with, which does exactly what I needed:
     
    Power Fx code when command button Input By is clicked:
    Patch(Investments,Self.Selected.Item,{Reviewer1:LookUp(Roles,Name=Text(Self.Selected.Item.'Trans Reviewer1'.Name),Name)});
     
    Note the use of commas instead of semi-colons, but then that may be a geographical based setting???
    Also note the table names are "pluralized".
    I've included the following in case anyone is curious why the Patch is written as it is:
  • Verified answer
    Jonathan Manrique Profile Picture
    2,678 on at
    Model Driven App Command Button To Post Look Up Value To Text Field
    Hi 
     
    You have two ways to achieve this
     
    I have a field called Requester against the users table
     
    One without the need for a button, simply using Power FX formula columns, when you select the approver in the lookup field, the name will appear in the text field
    'Requested By'.'Full Name'
     
    The other way is with the button that says you must make a patch
    Patch('Approval Requests';Self.Selected.Item;{'Approver Name Form 2':LookUp(Users;'Full Name'=Self.Selected.Item.'Requested By'.'Full Name' ).'Full Name'})
     
     

     
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    You can accept more than one post as a solution
    Follow me on Linkedin, I talk about Power Platform
    www.linkedin.com/in/jonathan-manrique-rios
     

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard