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 / Command Bar Preview -p...
Power Apps
Answered

Command Bar Preview -power fx syntax

(0) ShareShare
ReportReport
Posted on by 7

Currently using the patch command to copy a selected records values. This works great for text columns, but comes up blank for Fields that are Lookups. IE I have a field with a Customer Name or Project Name and this patch does not copy the data:

 

Patch('Hazards', Defaults('Hazards'), {'Customer Name': Self.Selected.Item.'Customer Name',Project:Self.Selected.Item.Project});
 
Does not error out but does not copy any data to those particular fields. Not supported or is my syntax ma
Categories:
  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @CallenAET In order to patch a LookUp column you need to provide a record for this field. So you Patch Would look like this

     

    Patch('Hazards', Defaults('Hazards'), 
    {'Customer Name': {
     Id: ,
     Value: ""
     },
    Project:{
     Id: ,
     Value: ""
     }
    });

     

    So you need to have the Id and the Value of the LookUp Lists item.

     

    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.

  • CallenAET Profile Picture
    7 on at

    Thank you!

  • AmariBarino Profile Picture
    59 on at

    Can this also be used in conjunction with the navigate feature? I am trying to navigate to a new form with a lookup field defaulted. 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard