question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chatbot taking default value instead of updated value....

See original GitHub issue

Hi,

–> Actually i created one state object with 1 value with default value like below—

constructor(props){
  super(props);
  this.state = {
    planSelected: 'planName'
  };
}

–> Im getting one value from child component and updating the above object value with the latest value what i got from child… –> Im successfully fetching value from child component and i override the previous value…

fetchData = (choosenPlan) => {
   this.setState({
   planSelected: choosenPlan
 });

–> After assigning new value , Im passing this new updated value of “planSelected” variable to some other child component using custom component like below…

{
          id: 'selectedPlanDeals',
          component: `<FetchPlanDeals planState = {this.state.planSelected}/>`,
           asMessage: true,
           trigger: 'userQuery',
 },

–> Problem is i’m not getting the updated value of “planSelected” in FetchPlanDeals component it is taking whatever default value i assigned. It is not taking overridden value…

–> Please give any solution. This is blocking my work.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
LucasBassetticommented, Aug 11, 2018

Why you not put the planSelected state in the FetchPlanDeals component?

0reactions
LucasBassetticommented, Aug 24, 2018

You can just pass attributes between steps. So if you select the language in the name step you need look for the steps.name in the custom component. Check the props received by Custom Component

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - chatbot : how to get default response when no ...
You need to only use one logic_adapter which will automatically return the default value if under the threshold set.
Read more >
How to use attributes - ChatBot
In ChatBot, we can distinguish default and custom attributes. ... User attributes allow you to store any value you want. To get the...
Read more >
Work with chatbot variables - Power Virtual Agents
Use variables with custom and prebuilt entities to created customized bot conversations.
Read more >
Default Answers - Chatfuel Help Center
A Default Answer is a bot's response to an unrecognized message. It is automatically sent every time your chatbot doesn't understand what the...
Read more >
Dialogflow Advanced Order Bot 03 – How to Pass ... - YouTube
Dialogflow Advanced Order Bot 03 – How to Pass Values Between Intents to Allow ... Dialogflow Chatbot - Using Contexts to Connect Intents....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found