Action Builder clear Slot before next scene

google-assistant

#1

Hi everyone,

Is it possible to clear the slot values and slotFillingStatus with jovo and how?

or

What is the right approach to use the slot filling in google action builder?
I’m running into a problem that the slots are still filled after the transition to my new scene where I want to gather other slots. There the condition “if scene.slots.status == “FINAL”” is true and doesn’t enter the rest of the scene.

I configured my scene like in the example from Google: The Jungle Escape

When they transition from the condition to the scene, they call a function in the webhook to clear all params. I think that’s their trick that in the next scene it doesn’t fullfill the first slot condition. Or do I miss something else?

/**
 * Clears params
 * @param {obj} conv, the conversation object.
 */
 function clearParams(conv) {
  for (const key in conv.session.params) {
    conv.session.params[key] = null;
  }
 }

I tried:
this.setSessionAttribute('riveranimal', null);
and
scene.slotFillingStatus = 'UNSPECIFIED';
and
delete scene.slots.riveranimal;

it seems like, the action holds its own slot value and ignores everything I do in the jovo webhook.

EDIT:
Right now I work with this workaround, at least with that, I come into the scene:
scene.slots.status == “FINAL” && session.params.riveranimal != “hippo”

Thank you for your help


#2

Hey!

Yes, we might need a helper method here. Could you provide the language model? So I can set this up at my environment easily


#3

@AlexSwe

unfortunately I just changed it yesterday into another working structure.
But I liked it better before.
I’ll try to recreate it today and can send you the language model.
Do you need the jovo language model?


#4

@AlexSwe

I tried to make a backup of my action before I recreate my other approach.
But the jovo build -p googleAction --reverse gives me some errors back:

Building language model platform model
Reversing model files
× en
→ Cannot read property ‘name’ of undefined
accountLinkingSecret.yaml
» Error: There was a problem:
» TypeError: Cannot read property ‘name’ of undefined

When I remember correctly, this Bug is already in work. So it has to wait until that :slight_smile: