Saving data from text element into database

Hello everyone,

I am using a text element to generate a random integer which then needs to be saved as a number in a field in a data type.

Have tried-

  1. converting text to number and saving it in custom state of the element and finally adding a thing from custom state to data type field, but doesn’t work. Entry gets created in database, but the field is blank.
  2. using input text element, but it doesn’t allow generating random number, so doesn’t solve the use case

Any help on 1) or any other method to save data from text element to data field, would be really helpful

thanks

There’s no way to reference a text element’s value in a workflow… so you’ll need to set the value (the random integer) somewhere else (i.e. in a custom state or a container’s datasource), then refer to that in both the text element and the workflow.

So the simplest way would be to have a group, with a content type of number - then generate the random integer in it’s datasource, then you can simply put the text element inside the group and refer to the parent group’s number in both the text element and any associated workflows.

1 Like

worked like you said

thanks mate :slight_smile:

1 Like