Bug Report from eh_gs #2021-1-18_14-25-17

OS info

  • Operating System : Mac OSX 17.7.0
  • Wappler Version : 3.7.7

Problem description

Data Store actions inside Dynamic Event Runs are not working. (I am using NodeJS)

Steps to reproduce

  1. Add the following step inside a Dynamic Event action:
    Data Store > Insert Record

  2. After doing this, console shows the following:

    Formatter insert in expression [state.insert({selected_campaign: 2, selected_id_campaign: 3})] doesn’t exist for type object

*Data Store > Insert Record works fine when being called from an independent Flow, even though they produce the same code inside the .ejs file
Flow code:

<script is="dmx-flow" id="flow1" type="text/dmx-flow" autorun>{
      run: {
        action: "{{state.insert({selected_campaign: 1, selected_id_campaign: 2})}}"
      }
    }</script>

Dynamic event code:

<dmx-serverconnect id="currCamp" url="../api/security/campaign" dmx-on:success="state.insert({selected_campaign: 2, selected_id_campaign: 3})">

Is the data store component added on a layout or on a content page?
What page are you calling it from with the dynamic event?

Both the dynamic event and the data store component are inside a Content Page.

Have the same problem. Did you solve it? How in that case?

Hello, tbh I’m not sure how I fixed it, but I must have found a workaround… I’ll go check what I did to accomplish the task as soon as I have some time.

*If you find a solution let me know to avoid the digging through my code :slight_smile:

It looks like you had a store called ‘state’ but SC elements use ‘state’ to indicate progress/completion of the call. Change the store name to something else and you’ll probably find it works.