I have a field “duration” which has several options according to their API docs: “A duration can be one of the following… “NONE”, “REMINDER”, or a integer greater than 0”
So it is either text or integer. I now have a text field which I thought would support both:
{
"name": "duration",
"type": "text",
"label": "Duration",
"help": "A duration can be one of the following... \"NONE\", \"REMINDER\", or a integer greater than 0"
}
However if I try to use the field in my module and enter a number I get a 400 error “Bad Request”.
body:
error: "Bad Request"
message: Array(1)
0: "duration can only be \"NONE\", \"REMINDER\" or an integer greater than 0"
Input data:
[
{
"name": "Test task",
"status": "todo",
"dueDate": "2024-02-10T03:00:00.000Z",
"duration": **"120"**,
"projectId": "b966fH76KAAToJaA92YBz",
"description": "Link: https://testlink",
"workspaceId": "weD2Y4Zf44sI6KQ0XXzHm",
"autoScheduled": {
"startDate": "2024-02-05T03:00:00.000Z"
}
}
]
When I set it to uinteger, the error is fixed because the quotes are removed in the API call. Due to the way the field is used, I don’t feel a nested select field is the best option. I want my users to be able to use general functions to determine the actual content. For example:
So what would be the best way to configure this parameter to support this mixed type for the app users? Is there a way to change the type based on the inputted data?