Use a Custom State like a traditional variable

Hello,

I’m trying to build a username field by combining first name and last name. I’m able to do that and store the value in a text field so I can see it on the screen. Now, I want to store the value in the text field in a custom state so I can use it in workflows, similar to like I would do in C# or Java. I’ve been struggling with this for a while now. Is there a way to achieve this? Another option is to skip storing the value in the text field and just use the text field. However, I don’t seem to be able to get to that in my workflow either.

Any help or ideas is appreciated.

Thanks!

Use an input field instead of a text field to have access to it in workflows.

1 Like

Have a look here. Fiddly workaround, but it works.
It’s a bit of a mystery why this isn’t more straight forward.

1 Like

I agree; it is a bit of a hack, but works perfectly! Thank you!

You can, in fact, compose a concatenation directly in the “pure expression” type box. Again, this may seem fiddly, but reading my explanation of how to do this (and why you have to) might be illuminating. Do not expect Bubble to “fix” this as nothing is in fact broken. The assignment field in a custom state is simply a general-purpose expression field not a text-specific expression field.

Read on and I think you’ll understand what I mean (you will also learn how to get to a full-featured text expression field from any general expression field, using a boolean expression):

This topic was automatically closed after 70 days. New replies are no longer allowed.