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
Neka
Helper III
Helper III

How include a value from the SetVariable activity that goes into the ForEach as part of the output?

Hello,

I have a SetVariable activity that has a JSON file going into my ForEach activity. Within the ForEach is a WebActivity1 that is using Workspace Id value from the SetVariable JSON file to call a Power BI REST API and get unused artifacts from that Workspace Id. There is another WebActivity2 after the first that saves the output of the WebActivity2 into a JSON file. I would like the Workspace Id value to appear before the Unused Artifacts that are found in that Workspace so that they are easier to find. How can I include the Workspace Id in the output from my ForEach? 

This is what the pipeline looks like:
SetVariable (JSON file containing WorkspaceId) -> ForEach {WebActivity1(Uses WorkspaceId to find unused artifacts) -> WebActivity2 (saves unused artifacts into JSON)}

Thank you for your help!

1 ACCEPTED SOLUTION

Hello,

Thank you for your help but I ended up using a different strategy. However, I also discovered that using this expression in the body of the web activity brought in the Workspace Id that was entering the ForEach:

@concat('{"workspaceId":"', item().id, '", "unusedArtifacts":', activity('UnusedArtifactsWebActivity_copy1').output, '}').

 

I will leave it here, if anyone needs it. 

View solution in original post

6 REPLIES 6
Neka
Helper III
Helper III

Hello again @Anonymous ,

Do you mean to replace the WebActivity1 with the copy activity? How do you use a CopyActivity to access the RESTAPI?

Thank you.

Anonymous
Not applicable

Hi @Neka ,

You can check for Rest in Copy Activity -

vgchennamsft_0-1714412897340.png


Or else if you can see the existing connection that created in Web Activity, try using it in Copy Activity.

Anonymous
Not applicable

Hello @Neka ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
Otherwise, will respond back with the more details and we will try to help .

Hello,

Thank you for your help but I ended up using a different strategy. However, I also discovered that using this expression in the body of the web activity brought in the Workspace Id that was entering the ForEach:

@concat('{"workspaceId":"', item().id, '", "unusedArtifacts":', activity('UnusedArtifactsWebActivity_copy1').output, '}').

 

I will leave it here, if anyone needs it. 

Anonymous
Not applicable

Hi @Neka ,

It was great to know that you were able to get to a resolution . We expect you to keep using this forum and also motivate others to do that same . You can always help other community members by answering to their queries

Anonymous
Not applicable

Hi @Neka ,

Thanks for using Fabric Community.
Inorder to do transformations ro your output json, can you use Copy Activity with Source as Rest API.
You can do some modifications to your json output with mappings option (like add columns).

I hope you got some insights.



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.