DataConnectors icon indicating copy to clipboard operation
DataConnectors copied to clipboard

On premises Data Gateway Data Source, for optional parameters does not work

Open scorpionfly7 opened this issue 3 years ago • 1 comments

Hi,

I am trying to use On - premises Data Gateway with my Custom connector, I added Test Connection section in my code:

DemoProject= [TestConnection = (dataSourcePath) => let json = Json.Document(dataSourcePath), parameter1 = json[parameter1], parameter2 = json[parameter2], parameter3 = json[parameter3] in { "DemoProject.Contents", parameter1, parameter2, parameter3}, Authentication = [ UsernamePassword = [ UsernameLabel = "Username", PasswordLabel = "Password", Label = "DemoProjectCredentials" ] ], Label = "DemoProject API" ];

My DemoProject.Contents looks like :

[DataSource.Kind="DemoProject", Publish="DemoProject.Publish"] shared DemoProject.Contents = Value.ReplaceType(DemoProjectImpl, DemoProjectType);

DemoProjectType = type function ( parameter1 as (type text meta [ DataSource.Path = false, Documentation.FieldDescription = "Defines parameter1" ]), parameter2 as (type text meta [ Documentation.FieldDescription = "Defines parameter2" ]), optional parameter3 as (type text meta [ Documentation.FieldDescription = "Defines parameter3." ])) as table meta [ Documentation.Name = "DemoProject" ];

DemoProjectImpl = (parameter1 as text, parameter2 as text, optional parameter3 as text) => let NavigationTables = DemoProjectNavTableQueryFolding(parameter1, parameter2, parameter3) in NavigationTables;

When I remove word optional for last parameter and remove DataSource.Path = false, I get 1

When one of this options or both are in place, I get 2

And also in in Gateway logs there is:

GatewayPipelineErrorCode=DM_GWPipeline_UnknownError GatewayVersion= InnerType=ValueException InnerMessage=[Expression.Error] The field 'parameter1' of the record wasn't found. InnerToString=Microsoft.Mashup.Engine1.Runtime.ValueException: [Expression.Error] The field 'parameter1' of the record wasn't found. at Microsoft.Mashup.Engine1.Runtime.RecordValue.IndexOf(String field) at Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(String field)......

Any ideas why it happens? @CurtHagenlocher @cwebbbi @fmms

Thanks a lot

scorpionfly7 avatar Oct 16 '20 10:10 scorpionfly7