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:
  • ronaldwalcott Profile Picture
    3,914 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

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard