Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
74 stars 80 forks source link

Validation failed when comma separated minutes are typed in 'At these minutes' param of Schedule Recurrence trigger #1859

Closed YOS0602 closed 1 year ago

YOS0602 commented 1 year ago

Describe the Bug with repro steps

bug detail

Workflow saved successfully. Workflow validation failed for the workflow 'XXXXXXXX'. {"error":{"code":"InvalidTemplate","message":"The template validation failed: 'The template trigger 'recurrence' at line '1' and column '226' is not valid: \"Error converting value \"0,15,30,45\" to type 'System.Int32[]'. Path 'schedule.minutes'.\".'."}}

repro steps

Workflow JSON

{
  "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "actions": {},
    "contentVersion": "1.0.0.0",
    "outputs": {},
    "triggers": {
      "recurrence": {
        "type": "Recurrence",
        "recurrence": {
          "frequency": "Week",
          "interval": 1,
          "timeZone": "Tokyo Standard Time",
          "schedule": {
            "hours": [
              "14",
              "15",
              "16"
            ],
            "minutes": "0,15,30,45",
            "weekDays": [
              "Sunday",
              "Saturday",
              "Friday",
              "Thursday",
              "Wednesday",
              "Tuesday",
              "Monday"
            ]
          }
        }
      }
    }
  },
  "connectionReferences": {},
  "parameters": {}
}

Screenshots or Videos

Browser

MacOS 13.1 M1 Chrome 111.0.5563.146(Official Build) (arm64) Safari 16.2 (18614.3.7.1.5)

Additional context

If this implementation is right and the docs are incorrect, I'll make a new issue for Logic App's documentation repo (https://github.com/Azure/logicapps)

docs: https://learn.microsoft.com/en-us/azure/logic-apps/tutorial-build-schedule-recurring-logic-app-workflow#add-the-recurrence-trigger

workflow JSON in wrong format like 0,15,30,45

{
  "schedule": {
    "hours": ["14", "15", "16"],
    "minutes": "0,15,30,45",
    "weekDays": [
      "Sunday",
      "Saturday",
      "Friday",
      "Thursday",
      "Wednesday",
      "Tuesday",
      "Monday"
    ]
  }
}

workflow JSON in correct format like [0,15,30,45]

{
  "schedule": {
    "hours": ["14", "15", "16"],
 -  "minutes": "0,15,30,45",
 +  "minutes": [0, 15, 30, 45],
    "weekDays": [
      "Sunday",
      "Saturday",
      "Friday",
      "Thursday",
      "Wednesday",
      "Tuesday",
      "Monday"
    ]
  }
}
Eric-B-Wu commented 1 year ago

Hello @YOS0602, thanks for reporting this issue! Currently looking into changing how we render the recurrence editor, and will include this change in my update