-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUERY] Define Default Value for Type Rich Text in OpenForm step #239
Comments
Yes, you should be able to define an Does that solve your issue? |
Is the The error I've got is attached below when I'm trying to define default value of type Rich Text
|
@baycak can you post your full |
Attached below @filmaj , Open snippet code here/**
* For collecting input from users, we recommend the
* OpenForm Slack function as a first step.
* https://api.slack.com/automation/functions#open-a-form
*/
const inputForm = UpdateRequestTestingWorkflow.addStep(
Schema.slack.functions.OpenForm,
{
title: 'Update QA Testing Form',
interactivity: prevInputForm.outputs.interactivity,
submit_label: 'Update',
fields: {
elements: [
{
name: 'title',
title: 'Title',
type: Schema.types.string,
default: prevInputForm.outputs.title,
},
{
name: 'description',
title: 'Description',
type: Schema.slack.types.rich_text,
description: 'Fill the description as detail as possible',
default: prevInputForm.outputs.description,
},
{
name: 'mentioned_to',
title: 'Mentioned to',
type: Schema.types.array,
items: {
type: Schema.types.string,
enum: [
'dummy'
],
},
description: 'A user groups which responsible to do a QA test',
default: prevInputForm.outputs.mentioned_to,
},
{
name: 'ui_stage',
title: 'UI Stage',
type: Schema.types.string,
description: 'Testing environment for UI',
default: prevInputForm.outputs.ui_stage,
},
{
name: 'api_stage',
title: 'API Stage',
type: Schema.types.string,
description: 'Testing environment for API',
default: prevInputForm.outputs.api_stage,
},
{
name: 'priority',
title: 'Priority',
type: Schema.types.string,
enum: ['Very High', 'High', 'Medium', 'Low', 'Very Low'],
description: 'Testing priority',
default: prevInputForm.outputs.priority,
},
{
name: 'estimated_release',
title: 'Estimated Release',
type: Schema.slack.types.date,
description:
'Estimated release feature / enhancement / bugfix to Production',
default: prevInputForm.outputs.estimated_release,
},
{
name: 'notion_link',
title: 'Notion Reference',
type: Schema.types.string,
description: 'Fill if necessary',
default: prevInputForm.outputs.notion_link,
},
{
name: 'jira_link',
title: 'Jira Reference',
type: Schema.types.string,
description: 'Fill if necessary',
default: prevInputForm.outputs.jira_link,
},
{
name: 'mr_gitlab',
title: 'MR Gitlab',
type: Schema.types.string,
description: 'Fill if necessary',
default: prevInputForm.outputs.mr_gitlab,
},
{
name: 'apk_build_link',
title: 'APK Build Link',
type: Schema.types.string,
description: 'Fill if necessary',
default: prevInputForm.outputs.apk_build_link,
},
{
name: 'device_type',
title: 'Device Type',
type: Schema.types.string,
description: 'Fill if necessary',
default: prevInputForm.outputs.device_type,
},
{
name: 'os_version',
title: 'OS Version',
type: Schema.types.string,
description: 'Fill if necessary',
default: prevInputForm.outputs.os_version,
},
{
name: 'cc',
title: 'Cc',
type: Schema.types.array,
items: {
type: Schema.slack.types.user_id,
},
description: 'Let others know about the QA test request',
default: prevInputForm.outputs.cc,
},
],
required: [
'title',
'description',
'ui_stage',
'api_stage',
'priority',
'mentioned_to',
],
},
}
); And for the value of description, can be seen here[
{
"type": "rich_text",
"block_id": "GS0LV",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"text": "gasfgasdfasdf",
"type": "text",
"style": {
"bold": true
}
},
{
"text": "\n",
"type": "text"
}
]
},
{
"type": "rich_text_list",
"style": "ordered",
"border": 0,
"indent": 0,
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"text": "gasdfasdf",
"type": "text",
"style": {
"bold": true
}
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "\\g",
"type": "text",
"style": {
"bold": true
}
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "a",
"type": "text",
"style": {
"bold": true
}
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "sdf",
"type": "text",
"style": {
"bold": true
}
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "a",
"type": "text",
"style": {
"bold": true
}
}
]
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "\n",
"type": "text"
}
]
},
{
"type": "rich_text_list",
"style": "bullet",
"border": 0,
"indent": 0,
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"text": "gasdfasdf",
"type": "text",
"style": {
"bold": true
}
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "asd",
"type": "text",
"style": {
"bold": true
}
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "fa",
"type": "text",
"style": {
"bold": true
}
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "sdf",
"type": "text",
"style": {
"bold": true
}
}
]
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"text": "\n",
"type": "text"
}
]
},
{
"type": "rich_text_preformatted",
"border": 0,
"elements": [
{
"text": "gadsfasdf",
"type": "text"
}
]
}
]
}
] |
Hey @baycak, we are looking into this. I believe it may be a bug on our end. Will keep you posted. |
@baycak I was able to get this to work by providing the const inputForm = GreetingWorkflow.addStep(
Schema.slack.functions.OpenForm,
{
title: "Send a greeting",
interactivity: GreetingWorkflow.inputs.interactivity,
submit_label: "Send greeting",
fields: {
elements: [{
name: "recipient",
title: "Recipient",
type: Schema.slack.types.user_id,
}, {
name: "channel",
title: "Channel to send message to",
type: Schema.slack.types.channel_id,
default: GreetingWorkflow.inputs.channel,
}, {
name: "message",
title: "Message to recipient",
type: Schema.slack.types.rich_text,
default: 'test',
}],
required: ["recipient", "channel", "message"],
},
},
); My guess is that the |
Yes @filmaj, by providing value as a string there is no issue. The issue arrived when I'm trying to add default value from previous Form which the value of rich text is as I mentioned before I believe value from rich text is defined as an array of object right not a string? CMIIW |
Correct, rich text ends up being an array with a variety of different objects within representing the various kinds of rich text, i.e. italic, bold, bullet points, so on. I will keep this issue open but have informed the Block Kit team internally about this use case, as I think it is valid. |
I see, well noted @filmaj Thank you, will waiting for the updates! |
Hi,
For the context I have building a Slack App which can submit a form to Slack Channels, with a capability to do Edit for form which already being submitted. Then one of the fields I'm using is using type
Schema.slack.types.rich_text
.The question is, is there any way to define default value for type
Schema.slack.types.rich_text
within a Workflow Form? Since value from type Rich Text is defined as Block Kit instead of plain textThank you!
The text was updated successfully, but these errors were encountered: