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 command button...
Power Apps
Unanswered

PowerFx command button on subgrid doesn't create new record

(0) ShareShare
ReportReport
Posted on by 17
 
 
HI everyone-
 
I am attempting to build a PowerFx command button when items are selected on a subgrid:
 
 
My code in the button is to just change the status of each item selected, change a field on the main Job record and then put a notification at the top of the screen:
 
Patch(
    'Job Items',
    ForAll(Self.Selected.AllItems,
        {
            'Job Item': ThisRecord.'Job Item',
            Status: 'Status (Job Items)'.Active,
            'Status Reason': 'Status Reason (Job Items)'.'Out for Delivery'
        }
    )
);
Patch(Jobs, Self.Selected.Item.Job,
    {
        'Items Marked for Delivery?': 'Items Marked for Delivery? (Jobs)'.Yes
    }
);
Notify("Delivery created!");
 
The only thing that runs is the notification. The rest of the code is being ignored or just not running? The command buttons are pretty new to me so any assistance is really appreciated about what I'm doing wrong here.
 
Thank you.
Joe
Categories:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,862 Moderator on at
    Not sure that Patch - For All works
    Try using For All -then Patch each individual record
    Try using Monitor to see what is happening with the updates


    I am not understanding where you are executing this code as Self normally refers to the control where the code is being executed. I would try an absolute reference to the control containing the data.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard