Skip to content
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

Triggering Data Exchange from RichText and Sending Video in User-Initiated Conversations #20

Open
mickbut-ler opened this issue Dec 13, 2024 · 9 comments

Comments

@mickbut-ler
Copy link

mickbut-ler commented Dec 13, 2024

I have two question:

  1. How can I invoke a data_exchange action directly from a screen containing a RichText component?
  2. How can I send a flow messages to a user with a video. Without using a template since its within a User-Initiated Conversations context.
@mickbut-ler
Copy link
Author

Sovled Q2: add video to the header.

"header": { "type": "video", "video": { "link": "https://transponder.petervanderlaan.nl/intros/streamfeeds_tv.mp4" } },

@lacogubik
Copy link
Contributor

Hi @mickbut-ler
I believe Q1 was answered in the forum.

@mickbut-ler
Copy link
Author

@lacogubik Sorry but the answer is not given. So could you please provide one?

@lacogubik
Copy link
Contributor

Can you clarify why the answer on the forum is not sufficient?

@mickbut-ler
Copy link
Author

mickbut-ler commented Dec 16, 2024

@lacogubik The answer I received was:

Can you clarify when you want to execute the data exchange? I.e. upon which user action?

Afterwards I have explained my usecase. However, I have still not received an answer on how I can trigger a data_exchange from a screen that contains the RichText component?

@lacogubik
Copy link
Contributor

@mickbut-ler You can trigger data_exchange like for any other screen. In the footer specify on-click-action as data_exchange and in the payload you provide data from RichText component.

@mickbut-ler
Copy link
Author

mickbut-ler commented Dec 17, 2024

@lacogubik Can you share an example of this? Since I get an error when I use another components besides the RichText. I have:

{
            "id": "RECIPE",
            "title": "Recept",
            "data": {
                "recipe": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "__example__": [
                        "|  | |",
                        "| --------   | --------  |",
                        "| img     |  **DISH TITLE** DESCRIPTION  |"
                    ]
                }
            },
            "layout": {
                "type": "SingleColumnLayout",
                "children": [
                    {
                        "type": "RichText",
                        "text": "${data.recipe}"
                    },
                    {
                        "type": "Footer",
                        "label": "Volgende Stap",
                        "on-click-action": {
                            "name": "data_exchange",
                            "payload": {
                                "action_type": "next_step",
                                "recipe_selected": "${data.recipe}"
                            }
                        }
                    }
                ]
            }
        }

Error: RichText cannot be used with other components on the same screen. Please either remove RichText from screen - "RECIPE" or ensure that it is the only component on the screen.

@lacogubik
Copy link
Contributor

@mickbut-ler Thank you for the example. I do apologise, I was wrong and you are right, it does not work with footer.
We will update JSON compiler to make it work and I will let you know here once it is working.

@lacogubik lacogubik reopened this Dec 17, 2024
@mickbut-ler
Copy link
Author

Thanks a lot @lacogubik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants