Open baycak opened 1 year ago
Yes, you should be able to define an initial_value
on it. See the Rich Text Fields reference.
Does that solve your issue?
Is the initial_value
are correct property to be define? Since I'm using Schema.slack.functions.OpenForm
instead of Slack Modal. From the documentation itself is using default
The error I've got is attached below when I'm trying to define default value of type Rich Text
parameter_validation_failed - Validation for parameter `fields` failed: elements_param_validation_failed - form_input_types_validate_fail
@baycak can you post your full OpenForm
step configuration, including all the fields
?
Attached below @filmaj ,
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 default
in an OpenForm rich text field as a string, e.g.:
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 prevInputForm.outputs.description
you are using for the default
value is not a string but maybe something else? Perhaps a more complex type?
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!