Forum Academy Marketplace Showcase Pricing Features

State Not Set in Reusable Element Workflow

Hi there, not sure if this is a bug or user error. So appreciate any help.

I have a page with a reusable element on it. The reusable element just contains a workflow, which I want to trigger via a custom action. The action for the time being simply writes the value of some custom states on the reusable element to a table.

The Set Up

  1. The page

  2. The workflow for the button click on the page

  3. The reusable element

  4. The workflow on the reusable element to write the values of custom states (set by the page) to the database table. First on page load:

  5. The workflow on the reusable element to write the values of custom states (set by the page) to the database table. Second on trigger of custom action:

The Problem

  1. OK. So when I initially load the page, and enter my values into the input boxes, then click on the button, here are the results in the database:
    Screen Shot 2021-09-14 at 11.34.44

Database content:

The values of the states that have been set, are missing from the database. My question is why?

UPDATE

The debugger shows the values being appended to the string in the “Create Log” action:

BUT the system logs show the values as missing from the “Create Log” action:

  1. If I simply click the button again, without changing anything else on the page, here are my results in the database:

Questions

  1. On second click of the button the values of the custom states are passed to the action. Why not on first click?
  2. Is this expected behaviour?
  3. Or is this a bug?

Thanks in advance.

I’m pretty sure I’ve had this issue as well, anyone else?