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

Get Fabric certified for FREE! Don't miss your chance! Learn more

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
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.