Displaying Dynamic List of Text without Inputs
1

How can I display a list of dynamic text in my app? I can show the list using CheckboxGroup or RadioButtonGroup, but I just need the text without the checkboxes or radio buttons. The use case is to summarize a flow where the final screen displays a list of text, this is dynamic. What’s the best approach for this?

Mick
Asked about a month ago
Selected Answer
1

You can use any of the text components available, and bind the text property.

As of today, you can also use the "RichText" component, which was released with Flow JSON version 5.1.

Here's an example Flow JSON:

{
    "version": "5.1",
    "screens": [
        {
            "id": "RECOMMEND",
            "title": "Feedback 1 of 2",
            "data": {
                "dynamic_text": {
                    "type": "string",
                    "__example__": "hello, world"
                }
            },
            "terminal": true,
            "layout": {
                "type": "SingleColumnLayout",
                "children": [
                    {
                        "type": "Form",
                        "name": "flow_path",
                        "children": [
                            {
                                "type": "TextBody",
                                "text": "${data.dynamic_text}"
                            },
                            {
                                "type": "Footer",
                                "label": "Continue",
                                "on-click-action": {
                                    "name": "complete",
                                    "payload": {}
                                }
                            }
                        ]
                    }
                ]
            }
        }
    ]
}
September 17 at 6:29 AM
Bar
Priyansh

This answer, @Bar, is not relevant to what was asked

I think OP wants to add text fields according to a dynamic list in the data (change the number of components at runtime).

I am also looking into something similar, and currently do not think there is a way. Will keep this thread updated if I find anything

Thanks!

September 20 at 12:25 PM
Bar

There is no way to change the number of elements on a screen at run time, that's correct. You can, however, change the visibility of elements at run time.

For text fields, you can now use the rich text component which gives you more control on the formatting. You can dynamically set the content in this component. This could theoretically help you achieve what I understand the OP is trying to do with text components.

September 23 at 9:52 AM