cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Question about how to use Errors Function in a ForAll Patch

Hi everyone,

we are trying to use Errors Function in a ForAll Patch to catch the errors, but the following code seems to do not work and doesn't populate any records from Errors Table. Can anybody help where is the mistake in the code?

Kind regards

 

Clear(collection)
ForAll(
     Filter(
          collectionTable,
           TablePK = x
     ),
Collect(
         collection,
         Patch(
Table,
Defaults(Table),
{
Field1: ThisRecordField1,

.

.

.

Fieldx:ThisRecordFieldx
}
)
)
);
ForAll(
collection,
If(
!IsEmpty(
Errors(
Table,
ThisRecord
)
),
Collect(
collectionErrorLog,
{
Error: First(
Errors(
Table,
ThisRecord
)
).Error,
Column: First(
Errors(
Staging_Jobs,
ThisRecord
)
).Column,
Message: First(
Errors(
Table,
ThisRecord
)
).Message
}
)
)
);

1 REPLY 1
JR-BejeweledOne
Super User
Super User

Have you setup a table on another screen with the Errors table as the data source to see if you can use it that way and if it's actually catching any errors?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,462)