Is it possible to use a variable in the default text of a text entry field?

Aug 18, 2022

Hello!

I'm currently developing a course where the goal is to have the user input text, then continue to tweak/change that text at various points throughout the course.

I thought this would be easy enough to do with text entry variables that I then pass through to be the default text of the next text entry field, but it doesn't appear to be working.

When I attempt to use a variable in the default text of a text entry field, the output that I get in preview/publish is just the raw text (e.g., "%Variable01%") instead of the actual content of the variable.

I've tested with a regular text box alongside to confirm that the variable is being set properly and it is, so this seems to be a specific problem with the default text of a text entry field not being able to reference variables. This doesn't appear intentional, as the variable in the editor still has the stylized change of automatically turning into the variable name with an outlined, yellow background.

Is there any way around this problem?

Thanks for your help!

5 Replies
Jose Tansengco

Hey Rob, 

Thanks for reaching out! 

I'm not sure if I understood your concern correctly, so I created the attached file as a jumping off point to be sure that we address it properly.

In my file, I assign a value to a variable and then pass this on to the 'Text Entry' box found in the succeeding slide. Is this what you are trying to do with the variables in your slide? And if it is not, would you be willing to upload a copy of your project file here or in private by opening a case so we can take a closer look at your design?  

Rob Beecher

Thanks for the reply! I've created a test file here to showcase what I'm trying to do and what isn't working.

Comparing it to your file, it seems that the issue may be that I'm using my own variable and putting it directly in the field instead of using & setting the default TextEntry? 

Rob Beecher

Yup, just tried deleting and remaking all my text entry fields and leaving them with the default variables (TextEntry, TextEntry1, etc.) and using the method you showed and it worked!

Thanks for the workaround! It was unclear to me that the default text in a text entry field gets set to the variable that it is also setting. Unintuitive, but it works! Still unclear if it is intended that manually set text in a field in-editor can't read variable values, but this works for now.

Thanks again!

Walt Hamilton

The sample you posted earlier will work with one small change. On slide one, the text entry box is tied to variable01 and on slide two, it is tied to variable02. What shows as the prompt is the variable that is tied to the entry box by the trigger.

To get variable01 to show in the entry box on slide two, maintain its contents, and change variable02, add this trigger to slide one:

If you don't need variable01 to retain its original value, change this trigger on slide two :

to this: