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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Reponen
Frequent Visitor

Fabric Set variable Select id from table

Hello,

 

I am pretty new with Fabric and Data factory.

I have currently proplem that my set variable selects whole row but i only need id column from table.

 

My SetVariable now:

@activity('GetDataFromTable').output.value" 
 
How i fix this?
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Reponen 

 

Thank you very much nilendraFabric for your prompt reply.

 

For a single row,

 

@activity('GetDataFromTable').output.value[0].id

 

Assume the output of GetDataFromTable is as follows:

 

{
  "value": {
    "id": 123,
    "name": "example",
    "age": 30
  }
}

 

Then @activity('GetDataFromTable').output.value.id will return 123.

 

For multiple rows:

 

@array(activity('GetDataFromTable').output.value, item().id)

 

Assume the output of GetDataFromTable is as follows:

 

{
  "value": [
    { "id": 1, "name": "Alice" },
    { "id": 2, "name": "Bob" }
  ]
}

 

Then @array(activity('GetDataFromTable').output.value, item().id) will return [1, 2].

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Reponen 

 

Thank you very much nilendraFabric for your prompt reply.

 

For a single row,

 

@activity('GetDataFromTable').output.value[0].id

 

Assume the output of GetDataFromTable is as follows:

 

{
  "value": {
    "id": 123,
    "name": "example",
    "age": 30
  }
}

 

Then @activity('GetDataFromTable').output.value.id will return 123.

 

For multiple rows:

 

@array(activity('GetDataFromTable').output.value, item().id)

 

Assume the output of GetDataFromTable is as follows:

 

{
  "value": [
    { "id": 1, "name": "Alice" },
    { "id": 2, "name": "Bob" }
  ]
}

 

Then @array(activity('GetDataFromTable').output.value, item().id) will return [1, 2].

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

If i try to use it says that 

@Item() syntax can only be used in the filter activity or child activities of a foreach activity
@array(activity('GetDataFromTable').output.value, item().id)

 

This code works @activity('GetDataFromTable').output.value[0].id

but gives only first id.

I need a array of ids

nilendraFabric
Super User
Super User

Hello @Reponen 

 

Matching: Ensure the column name `id` matches exactly (case-sensitive) with your table schema.

 

 

 

@activity('GetDataFromTable').output.value[0].id

 

Or 

 

@activity('GetDataFromTable').output.value.id

 

if this is helpful please accept the answer and give kudos

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.