Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
smeetsh
Resolver II
Resolver II

Creating/wrting a file when an activity fails

Hi All,

 

I have a pipeline that does a rest call using and ID and a party ID to get information from a rest api. One of the combinations of ID and party ID will always throw a 403 error, while on the next loop it will find its working combination. This is caused due to some legacy clean ups, which i have no control over to fix. To clarify with an example

 

Combination ID1 with party ID 5 will throw error 403, ID1 with Party ID 6 will get me the info. Since this is a loop of sevral cambinations of ID's and party ID's the pipeline will continue to run and finish eventualy, but it will finish with an error, even though that is not really the case.

In the past , using power automate, I could create and if step that said if error code is 403, do nothing. Crude but effective, and the flows ran without errors.

In fabric that option doesnt seem be there, or does anyone know a way to capture an error like that? The only thing I can think off is adding a mail activity that kicks off, in case the previous activity fails.

The built in if condition in Fabric doesnt seem able to read the output of het http body and read the status code (200, 403 etc ), which would be the cleanest option, but even then I do not see a way for it to do a filesystem task like in powerautomate, where it can write a file to my lakehouse as a form of log.

Does anyone have an idea how to tackle this?

 

Thanks

Hans

1 ACCEPTED SOLUTION

In case if you want to capture the error message, you can use the below expression for the same
@activity(‘ActivityName’).error.message




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

View solution in original post

5 REPLIES 5
smeetsh
Resolver II
Resolver II

The actual error on the GET request is just a standard 403 error. I know why it's there, but I cant prevent it because it has to loop through all of the combinations

 

What I am looking for is a way to capture the response code, in this case a 403

 

smeetsh_1-1716940760028.png

The copy data action uses a concatenated variable, which is the url to use for the http get request

smeetsh_2-1716940893334.png

 

smeetsh_4-1716940982199.png

 

 

The destination is just json files, which work fine



In case if you want to capture the error message, you can use the below expression for the same
@activity(‘ActivityName’).error.message




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Hi @smeetsh 

 

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.

 

Thanks.

Hi All,

 

I hadn't been able to do anymore development until now. I used the "@activity(‘ActivityName’).error.message" and was able to set a variable with it, which is then inserted in an email.

It does copy the full error message, not just the code. It's not to pretty but it does what i needed, so good enough for me 🙂 

v-cboorla-msft
Microsoft Employee
Microsoft Employee

Hi @smeetsh 

 

Thanks for using Microsoft Fabric Community.

Could you please provide some more details like screenshots of your copy activity and the error message, in order to understand and guide you in a better way.

 

Thank you.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.