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 / PowerFX | Button in or...
Power Apps
Unanswered

PowerFX | Button in order to create a Record with pre-filled field values!

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi!

 

I am trying to use PowerFX to create a button that in the following creates a record and pre-fills certain fields. I got no experience with Power Apps or PowerFX thus I dont know how the syntax is written properly to achieve this requirement. 

 

Maybe anyone could help me out!

 

Thanks in advance!

 

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,543 Most Valuable Professional on at
    • Where are you trying to create the button?  In a Power App or somewhere else?
    • Where will the record be stored?  What data source?
    • What fields will the record contain?  Where is the data coming from to pre-fill the fields?

    We need a bit more information to be able to help you with the syntax.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Pstork1 Hi!

    1. The button will be within the D364 Marketing App
    2. Data is stored within the Dataverse CRM
    3. It contains fields from the Web Page Entity (e.g. adx_websiteid) 

    newmay_0-1638227892917.png

    Thanks for reaching out!

  • ChrisPiasecki Profile Picture
    6,428 Most Valuable Professional on at

    Hi @Anonymous,

     

    Have you looked into Business Rules to see if that can accomplish your needs? You can set default values on fields based on simple criteria. Note that with business rules you can't evaluate values on related records. 

     

    If your business logic needs to be a bit more complex and look at related parent or child records, you can use a Power FX command button to perform business logic. You can also use JavaScript if PowerFX commands can't achieve the behavior. 

     

    Have a review of the links and see if those will work for you. You'd need to provide a bit more details on what your business logic needs to do based on what criteria, so that we can advise on the best approach. 

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @ChrisPiasecki !

     

    I already created a button with PowerFX, yet I am not sure how to write the formular properly for my requirement.

     

    1. The logic behind is as following:I created a subarea called "Portal Content Management" within the Sales App newmay_1-1638266526090.png
    2. Create a button that creates a new web page record with pre-filled fieldsnewmay_2-1638266722640.png

       

    3. newmay_3-1638266824884.png

    I want to know how the formular is written properly in order to create and pre-fill a record. If you could give me an example of the newmay_4-1638267047256.png  formula I could adapt it.

    I just dont know which commands are used to create records and which are used to set values on a record.

     

    Basically there is no specific criteria, it is only for usability so that users can create a webpage for the dynamics portal within a CE App without having to fill out fields that stay the same all the time. Afterwards I will lock these fields on the form so they cant change the default website for example.

     

     

     

    .

  • gvanlue Profile Picture
    2 on at

    Hi @Anonymous, you're looking for Patch. 

     

    Microsoft Document: https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-patch

    Example Formula for new records to be created:

     

    Patch( Customers, Defaults( Customers ), { Name: "Contoso" } )

     

    In the curly brackets, add the fields you want separated by commas and the default information you want filled in. Working with the different types can be a little tricky depending on what you want filled, an easy way to test your formula is to use the Helper Screen in the component library screens or setup a canvas app and add the table. 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard