Javascript modified data not saved

Hey Bubblers,
Something is driving me crazy. Spend almost a day but no clues.

I have an input field with ID: inputField1 and I am running a workflow on value change to run a javascript.

The javascript modifies the value of the first word to uppercase. The javascript is saved in the body from setting and calling from workflow with the variable as the input field’s ID.
input field’s ID.

Everything works and the modified value is displayed in the input field but when I save the modified value (uppercase), the modified value is not saved.


Use step by step debugger to see what input is being passed through.

My thought would be:

That’s because you are manipulating the DOM, not the app. The data of the input is stored I. The memory managed by the app after each keystroke. Since you change the value of the input via JavaScript, the app doesn’t realize it’s updated and therefore it’s value is not realized during the save.

When you save the record, the app isn’t pulling the value from the input directly, rather it pulls it from a variable saved in the app itself that gets updated when the input is updated by a user, not code as you have done.

Hi @jared.gibb,

I appreciate your prompt reply. Is there a possible solution or alternative approach you could suggest? I would greatly appreciate your assistance.

Hi there, I really appreciate your response.

Here is the screenshot of step by step debugger.

The modified value is not passed while saving the value.

I have a follow question:

Why use str8 js to do this. Why not use a bubble expression to modify the text to be saved

You could, bind the inputs init value to a state and update the state after the input is changed to be the corrected value. That might then update the input. You may need to reset the input first after setting state. That may work.

Agree with this. In fact, if you already have the value from JS, why not just pass it directly to the workflow step instead of using the input value? Saves one additional headache.

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