Hi,
Trying to patch the existing SP list record choice column with the attached command but unable to get the result
After execution the gethelp on error shows "The specific record was not found" though SP list has the record with status"Reported".
Appreciate a quick help
Solved! Go to Solution.
Hi @shoebwk ,
Could you tell me:
1)status field data type?
2)what does "ThisRecord" represent? a variable ? or something else?
If you want to update all the items that ApprovalStatus = "Reported" to ApprovalStatus:"Approved", you should use formula like this:
ForAll(
RenameColumns(
Filter(
GalleryReported.AllItems,
ApprovalStatus = "Reported"
),
"ID","ID1"),
Patch(
Mobility,
ID=ID1,
{ApprovalStatus:"Approved"}
)
)
If Status is single choice column, try this formula:
ForAll(
RenameColumns(
Filter(
GalleryReported.AllItems,
Status.Value = "Reported"
),
"ID","ID1"),
Patch(
Mobility,
ID=ID1,
{Status: {Value: "Approved"}}
)
)
Best regards,
Try the following code instead
ForAll(
Filter(
GalleryReported.AllItems,
Status.Value = "Reported"
),
Patch(
Mobility,
ThisRecord,
{Status: {Value: "Approved"}}
)
)
Since Status is a Choice column you have to patch it with an object record. {Value:"Approved"} will set the value property of the Status record.
Change it to use the internal field name. I tested it on a choice column in one of my lists where the internal name is 'status' and it works for me.
I am not sure why it is not work.
Here I removed the complex column dependencies and now both the columns in powerapps in SP list are text field. Still I am getting the same error
ForAll(
Filter(
GalleryReported.AllItems,
ApprovalStatus = "Reported"
),
Patch(
Mobility,
ThisRecord,
{ApprovalStatus:"Approved"}
)
)
Hi @shoebwk ,
Could you tell me:
1)status field data type?
2)what does "ThisRecord" represent? a variable ? or something else?
If you want to update all the items that ApprovalStatus = "Reported" to ApprovalStatus:"Approved", you should use formula like this:
ForAll(
RenameColumns(
Filter(
GalleryReported.AllItems,
ApprovalStatus = "Reported"
),
"ID","ID1"),
Patch(
Mobility,
ID=ID1,
{ApprovalStatus:"Approved"}
)
)
If Status is single choice column, try this formula:
ForAll(
RenameColumns(
Filter(
GalleryReported.AllItems,
Status.Value = "Reported"
),
"ID","ID1"),
Patch(
Mobility,
ID=ID1,
{Status: {Value: "Approved"}}
)
)
Best regards,
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
208 | |
207 | |
85 | |
58 | |
35 |
User | Count |
---|---|
334 | |
259 | |
132 | |
87 | |
60 |