Bonjour,
Depuis Power Automate (Cloud), je souhaite appeler un script Excel dont voici la signature:
Lorsque j'appelle ce dernier avec des paramètres "en dur", je ne rencontre aucune difficulté.
Code : Sélectionner tout - Visualiser dans une fenêtre à part function main(workbook: ExcelScript.Workbook, modificationDate?: string): void
Par contre, lorsque je l'appelle avec des paramètres dynamiques, j'obtiens une erreur d'éxecution (Bad Request).
Ci dessous les paramètres de l'action:
Sachant que le paramètre ScriptParameters est généré par l'expression suivante:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 { "host": { "connectionReferenceName": "shared_excelonlinebusiness", "operationId": "RunScriptProdV2" }, "parameters": { "source": "sites/monSharepoint.sharepoint.com,20f52372-c37d-4b11-a1ac-04a33a7aaf00,b2344558-5024-44de-9896-e2e6c1afab9a", "drive": "b!ciP1IH3DEUuhrASjOnqvAFhFNLIkUN5EmJbi5sGvq5pwFJ7oF97GSJkf7crrX_em", "file": "(Extraction 26052025) monFichierExcel_2025-05-26-08-00-55.xlsx", "scriptSource": "sites/monSharepoint.sharepoint.com,20f52372-c37d-4b11-a1ac-04a33a7aaf00,b2344558-5024-44de-9896-e2e6c1afab9a", "scriptDrive": "b!ciP1IH3DEUuhrASjOnqvAFhFNLIkUN5EmJbi5sGvq5pwFJ7oF97GSJkf7crrX_em", "scriptId": "01S77DOGU3367HTGWJWZDLRVLDQ3CCLNXG", "ScriptParameters": { "modificationDate": "26052025" } } }
setProperty(json('{}'), 'modificationDate', variables('FilePrefix'))
et la variable FilePrefix contient la valeur suivante:
26052025
Et la sortie:
Que faire ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 { "statusCode": 400, "headers": { "Cache-Control": "no-store, no-cache", "Access-Control-Expose-Headers": "Version", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "mise-correlation-id": "826717a8-7586-4e54-92a5-b9af5d195fa1", "x-ms-workflow-name": "6da73018-df7d-45be-a860-b4ead39641cc", "Version": "3.8", "x-ms-client-request-id": "b728cbc2-6d79-46b9-aba8-ffb48d54d1aa", "Reporting-Endpoints": "CREMSEndpoint=\"https://csp.microsoft.com/report/Office365-OfficeScripts-RestApiService-prod\"", "Content-Security-Policy-Report-Only": "default-src 'none'; base-uri 'none'; sandbox;report-to CREMSEndpoint; report-uri https://csp.microsoft.com/report/Office365-OfficeScripts-RestApiService-prod", "x-ms-request-id": "b728cbc2-6d79-46b9-aba8-ffb48d54d1aa", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "DENY", "x-ms-environment-id": "default-24282520-9fc9-4302-96d4-16762af4f697", "x-ms-tenant-id": "24282520-9fc9-4302-96d4-16762af4f697", "x-ms-dlp-re": "excelonlinebusiness|False", "x-ms-dlp-gu": "-|-", "x-ms-dlp-ef": "-|-/-|-|-", "Timing-Allow-Origin": "*", "x-ms-apihub-cached-response": "true", "x-ms-apihub-obo": "false", "Date": "Mon, 26 May 2025 08:55:54 GMT", "Content-Length": "215", "Content-Type": "application/json" }, "body": { "message": "We were unable to run the script. Please try again.\nRuntime error: Line 127: Cannot read properties of null (reading '1')\r\nclientRequestId: b728cbc2-6d79-46b9-aba8-ffb48d54d1aa", "logs": [] } }
Partager