File tree Expand file tree Collapse file tree
apps/sim/tools/microsoft_dataverse Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,10 @@ export const dataverseGetEntityMetadataTool: ToolConfig<
6161 request : {
6262 url : ( params ) => {
6363 const baseUrl = getDataverseBaseUrl ( params . environmentUrl )
64- const entityLogicalName = params . entityLogicalName . trim ( )
64+ // OData string literals escape embedded single quotes by doubling them - URL-encoding the
65+ // quote alone isn't sufficient since Dataverse URL-decodes the request before parsing the
66+ // OData key predicate, so a percent-encoded quote would still land as a literal delimiter.
67+ const entityLogicalName = params . entityLogicalName . trim ( ) . replace ( / ' / g, "''" )
6568 const queryParts : string [ ] = [ ]
6669 if ( params . select ) queryParts . push ( `$select=${ encodeURIComponent ( params . select ) } ` )
6770 if ( params . includeAttributes === 'true' ) {
@@ -91,7 +94,7 @@ export const dataverseGetEntityMetadataTool: ToolConfig<
9194 throw new Error ( errorMessage )
9295 }
9396
94- const data = await response . json ( ) . catch ( ( ) => ( { } ) )
97+ const data = await response . json ( )
9598 const displayName = data ?. DisplayName ?. UserLocalizedLabel ?. Label ?? null
9699
97100 return {
You can’t perform that action at this time.
0 commit comments