cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
scorpionfly
Helper II
Helper II

Validate function parameter on range

Hi,

I have

[DataSource.Kind="Test", Publish="Test.Publish"]
shared Test.Contents = Value.ReplaceType(TestImpl, TestType);

TestType = type function (
duration as (type number meta [
DataSource.Path = false,
Type = "Singleton",
MakeResourcePath = () => "TestConnector",
ParseResourcePath = (resource) => { },
Documentation.FieldCaption = "Lookback duration",
Documentation.AllowedValues = { 1..30 },
Documentation.SampleValues = {"25"},
Documentation.FieldDescription = "Defines how many days starting from today the connector will look back in time. It can be maximum 30 days"
]),
environment as (type text meta [
Documentation.FieldCaption = "Environment",
Documentation.AllowedValues = { "Test", "Dev", "Prod" },
Documentation.FieldDescription = "Defines which environment data, do you want access"
]))
as table meta [
// appears in the initial datasource parameter configuration dialog
Documentation.Name = "Test"
];

TestImpl = (DurationValue as number, Environment as text) =>
let

......

 

Is it possible show to user message if value of duration not from 1 to 30...I dont want Documentation.AllowedValues = { 1..30 }, dropdown...I want it be text field. @artemus 

1 ACCEPTED SOLUTION
artemus
Microsoft
Microsoft

No, the most you can do is use Documentation.FieldDescription and Documentation.FieldCaption, and then fail in the TestConnection.

View solution in original post

1 REPLY 1
artemus
Microsoft
Microsoft

No, the most you can do is use Documentation.FieldDescription and Documentation.FieldCaption, and then fail in the TestConnection.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors