Hello,
I'm unable to find a solution for this specific example.
Goal: User selects one or more records from a gallery using checkboxes and is routed to a screen to perform different actions. One action is to simply click a button and the choice field for all associated records is set to "Returned".
Return Button:
Patch('Main Data',ForAll(Collect_List1,{Status: "Returned"}));
Clear(Collect_List1);
Back()
ForAll(Collect_List1,
Patch(
'Main Data',
Defaults('Main Data')
,{Status: {Value: {"Returned"}}
)
);
Clear(Collect_List1);
Back()
I'm receiving error: The type of this 'Status' does not match the expected type 'Record'. Found type 'Text'.
ForAll(Collect_List1,
Patch(
'Main Data',
Defaults('Main Data')
,{Status: "Returned"}
)
);
Clear(Collect_List1);
Back()
Thanks for the response. I added the update function but still can't seem to make it work. I'm new to Power Apps and sure I'm missing something simple.
ForAll(Collect_List1,
Patch(
'Main Data',
//YOU NEED TO INSERT HERE IT IS NEW OR UPADTE
,{Status: "Returned"}
)
);
Clear(Collect_List1);
Back()
That formula should work for you. You just need to say if it is a new record if you are updating a record
https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-patch
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
My website!
My blog!
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional