Forum Discussion
aammontecas
4 years agoNew Member
Convert name to id for use in m query
Hello, I am using Query Parameters to format a call to an API to return data for a given trackingId. I have a table with userName, trackingId. I want to call an API to populate a new table, the i...
Anonymous
4 years agoNot applicable
Hi aammontecas
I would approach this problem by creating a Table with two columns. Name and ID.
A List of Name can be created using the "Name" column. This List of Names can be used in the Parameter settings. This is example from the Manage Parameters panel.
Finally, in the main API call, you can use the "Name" value to search for the "ID" value. The M script is something like this:
#"Name Table"{[Name=#"Parameter Value"]}[ID]
This seraches for the Table, finds the row number for the parameter name and then returns the ID value.