Input value to a field (this should be simple...)

Newbie here

The aim is to provide the user with 2 options to enter data (number):

(1) Simply enter (type) the number (50) into the input field . No problems with this. It works.

(2) Click on an associated icon (image) which has a numerical value (50) and by doing so input that value into the field. I am not sure how to do this. Not sure if it must be a group or what but not able to get this working.

Suggestions please? TIA

Hi there, @megaphonepalā€¦ one way you can do what you described is by using a custom state. You could create a custom state, say, at the page level, and you could set the input elementā€™s Initial content field to be the custom state. Then, when an icon/image is clicked, you would run a workflow to set the custom state to a numerical value, and that value would then automatically appear in the input. Make sense?

Hope this helps.

Bestā€¦
Mike

1 Like

Thanks Mike. Working on this slowly to understand what is going on and doing the tutorial. Will update you shortly on the outcome. Hopefully a success story :wink:

Cheers

1 Like

Hi again.

I have not been able to get it to work. This is what I have done so far:

(1) Created a custom state (ā€œicon_valueā€) for the element (ā€œ50H Groupā€) with a default value of 50 - See image A

(2) Set stateā€™s icon_value of 50H Group. Then set the value of 50Hā€™s Groupā€™s icon_value - See image B

ā€¦ I suspect there is something wrong with the last part for ā€˜Set state valueā€™. If nothing else, I have not found a way to instruct the workflow to enter the value (50) into the input field (ā€œInput Headā€™s Numberā€)

This link on Evernote might make more sense of things:

Thanks
Pete

Youā€™re close. :slight_smile:

In image A, remove the default value for the custom state. In image B, set the value to 50 (literally the number 50). Then, open the edit dialog for the input element that is supposed to show a value of 50 when the group is clicked, and set the Initial content field for that element to 50H Group's icon_value. At that point, you should be good to go.

1 Like

Hi Mike,

Issue:
By clicking on the 50 H token, the value (50) is input into the ā€˜Input Heads Numberā€™ field (as it should be), but the value is not processed by hitting return or clicking on the ā€˜Start Tossingā€™ button (expected behavior).

Please see diagrams on the Evernote link.

Thanks

The problem at this point is you are putting the custom stateā€™s value in the Placeholder field instead of the Initial content field. So, uncheck the box for auto-binding and the Initial content field will appear. Then, remove the value from the Placeholder field and put that value in the Initial content field, and you should be good to go.

2 Likes

Getting closer :thinking:

The Problem:

I have incorrectly set the input field (ā€œInput Heads Numberā€) for the Initial content to ā€œ50 H Groupā€™s Icon value.ā€ But doing it this way, it only works if there is just one icon being clicked, namely the 50 H one. But as there are other icons (51 H, 52 H etc), it will not work for those ones the way I have set it up.

How would I address this issue?

Diagrams here

Thanks

Are we? It doesnā€™t feel like it. :wink:

Just have one custom state that is a number, and set the Initial content of the input to that custom state. When any of the icons are clicked, use a workflow to set the custom stateā€™s value to the number associated with the icon. It should be that simple.

If you want to give me edit access to your editor (privately), I will set it up for you. It would probably be easier than continuing to go back and forth here.

1 Like

One issue you might have is that ā€œInitial Contentā€ literally means, ā€œinitialā€. If the user enters a value manually into the input box , the value entered overrides the dynamic custom state expression so it will no longer have a binding to the custom state and wonā€™t reflect any other changes. The way to overcome this is to put the input box in a group, set the Content Type of the group to ā€œnumberā€ and the Data Source of the Group to the custom state. On the actual input box set the Initial Content to ā€œParent Groupā€™s numberā€. This creates a 2-way binding between the inputā€™s container group and the custom state. Hope this helps.

4 Likes

Thanks for the input.