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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
cameroon
Frequent Visitor

Dynamic Table when calling data from API

I am getting data from an API request which requires me to include a number of parameters that are dynamic.  The first one is the ID of the circuit I wish enquire on.  I have set this up to allow the user to select the relevant ID so that the GET statement is updated accordingly (fldPhase2ID)

cameroon_0-1698566695399.png

The API request changes as expected and returns the required data.  I am not sure the correct terminology in terms of how the data is returned but see below

cameroon_1-1698566832083.png

The 23860 is the ID as selected by the user, so can obviously change so I am trying to make 

#"Phase to find" = Source[23860]

dynamic.  I have tried the following with no luck - error message "Invalid Identifier"

#"Phase to find" = Source[Text.From(fldPhase2ID)]

I have also tried withoug the Text.From function and get the following error

cameroon_2-1698567229943.png

BI is not my strength, so I am sure what I am trying to do is simple, but I'm certainly out of my depth.  Any help appreciated

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @cameroon 

In this case, the Source step is returning a record with a single field whose name corresponds to fldPhase2ID.

 

Either of these should work for the Phase to find step:

1. Return the value of the field whose name corresponds to the value of fldPhase2ID:

#"Phase to find" = Record.Field( Source, Text.From( fldPhase2ID ) )

or

2. Return the value of the first field of the record:

#"Phase to find" = Record.FieldValues( Source ){0}

 

I would probably recommend method 1.

Does this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @cameroon 

In this case, the Source step is returning a record with a single field whose name corresponds to fldPhase2ID.

 

Either of these should work for the Phase to find step:

1. Return the value of the field whose name corresponds to the value of fldPhase2ID:

#"Phase to find" = Record.Field( Source, Text.From( fldPhase2ID ) )

or

2. Return the value of the first field of the record:

#"Phase to find" = Record.FieldValues( Source ){0}

 

I would probably recommend method 1.

Does this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hi @OwenAuger 

 

Never tried option 2 as option 1 worked perfectly.  I understand the logic of it, but know there was no way I was getting there on my own.  Thanks for the help

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.