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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Getting error while creating multiple parameters using meta in a single function

I am trying to pass the list as a paramter in the API.contents() function for which I am creating a parameters function using meta. If I created a single parameter then it works fine but if I am creating a function for multiple parameters I get below error.

Sneha_thakur_0-1680172884879.png

What can i do to solve this issue. Any lead would be appreciated.

Code - 

section User_API_Param;

[DataSource.Kind="User_API_Param", Publish="User_API_Param.Publish"]
shared User_API_Param.Contents = Value.ReplaceType(parameters, ScopeType);

ScopeType = type function (
message as (type text meta [
Documentation.FieldCaption = "Limit",
Documentation.FieldDescription = "Enter a limit",
Documentation.SampleValues = {"1", "2"}
]),
name as (type list meta [
Documentation.FieldCaption = "limit range",
Documentation.AllowedValues = { "1", "2", "3" }
]))
as any;


parameters = (limit as text, optional limitrange as list) =>
let
accesstoken = Extension.CurrentCredential()[Key],
baseUrl = "https://api.example.com/",
endpoint = "/users",
Headers = [
Authorization = "Bearer " & accesstoken
],
source = Web.Contents(baseUrl,[RelativePath = endpoint & "?limit=" & limit, Headers = Headers, ManualCredentials = true]),
Value = Json.Document(source),
data = Value[data],
ToTable = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
ExpandCol = Table.ExpandRecordColumn(ToTable, "Column1", {"id", "name", "email", "authType", "roles"}, {"id", "name", "email", "authType", "roles"}),
Roles = Table.ExpandListColumn(ExpandCol, "roles"),
RolesData = Table.ExpandRecordColumn(Roles, "roles", {"role"}, {"role"}),
ExtractRoles = Table.ExpandRecordColumn(RolesData, "role", {"id", "name"}, {"id.1", "name.1"}),
RenameRoles = Table.RenameColumns(ExtractRoles,{{"id.1", "Role_id"}, {"name.1", "Role"}})
in
RenameRoles;

// Data Source Kind description
User_API_Param = [
Authentication = [
Key = []
// UsernamePassword = [],
// Windows = [],
// Implicit = []
],
Label = Extension.LoadString("DataSourceLabel")
];

// Data Source UI publishing description
User_API_Param.Publish = [
Beta = true,
Category = "Other",
ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
LearnMoreUrl = "https://powerbi.microsoft.com/",
SourceImage = User_API_Param.Icons,
SourceTypeImage = User_API_Param.Icons
];

User_API_Param.Icons = [
Icon16 = { Extension.Contents("User_API_Param16.png"), Extension.Contents("User_API_Param20.png"), Extension.Contents("User_API_Param24.png"), Extension.Contents("User_API_Param32.png") },
Icon32 = { Extension.Contents("User_API_Param32.png"), Extension.Contents("User_API_Param40.png"), Extension.Contents("User_API_Param48.png"), Extension.Contents("User_API_Param64.png") }
];

0 REPLIES 0

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.