Issue with Default Role Selection and Hidden Value in Canvas Template

I’m having trouble with setting a default role selection in my Bubble app. I’m using the default template from Canvas, which has some hidden fields for role selection. I have two roles to choose from, and I understand that I need to set a default value for this hidden field to make it work correctly.

I’ve already created a custom state called role for my component to track the selected role. My assumption is that I need to set this custom state on page load using a workflow. However, when I try to implement this, it doesn’t seem to work.

Has anyone else run into this issue with hidden fields and default values in Canvas templates? How can I properly set the default value for the hidden field? Are there specific steps I need to follow to ensure the value is set correctly on page load?

Here few screenshots of current state:

  1. UI

  2. this hidden component for handle selected user type

  3. here this too

  4. same button with data source

  5. this how looks workflow when click one of this button

What I tried on page load set data into this hidden field:
1.


2. Professional text I take from state dirrectly but set data for some reason setup ‘standart’ role

p.s while writing this question I think why is it some hidden varibles, why not use custom state?


Hope this helps! :smiley:

1 Like

almost, but in this case, how should it work if we click ‘Button User Type 2’ ?
Not really understanding how it works if ‘var - selected user type’ is contain just data source Button User Type 1’s text, but how it works for another button?

Up, I don’t understand how this works. Who can explain?

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