Bug Report: Form State ($state) Not Properly Injected in Run Code

Issue Summary:

Form Fields are not properly exposing their values to $state in Run Code, despite correct configuration.

Configuration Details:

  • Form component with Initial Values set as JSON: {"email": "", "password": "", "confirmpassword": ""}

  • Form Fields properly nested inside Form component

  • Field keys correctly configured: “email”, “password”, “confirmpassword”

  • All inputs properly contained within their respective Form Fields

Observed Behavior:

  • Console shows Form structure exists: Input: Proxy(Object), password: Proxy(Object), confirmPassword: Proxy(Object)

  • However, actual field values return undefined: email: undefined, password: Proxy(Object) {value: undefined}, confirm: undefined

  • This occurs even when fields are visibly filled with data

  • Issue persists across different browsers and incognito mode

Expected Behavior:

Form Fields should expose their values to $state for use in Run Code, similar to how integrated Supabase forms work automatically.

Technical Context:

This appears related to the known issue where dynamically rendered Form Fields don’t properly initialize their state values, even when Initial Values are set at the Form level. The Form structure is recognized but field values aren’t being captured or exposed to the $state object.

Impact:

Unable to access form data in custom Run Code for form submission handling.

Run code in button:
(async function () {
// :magnifying_glass_tilted_right: Debug do state
console.log(“DEBUG STATE:”, $state);
console.log(“email:”, $state.email);
console.log(“password:”, $state.password);
console.log(“confirm:”, $state.confirmpassword);

const path = window.location.pathname || “”;
const client =
path.startsWith(“/a-”) ? window.supabaseAgency : window.supabaseCompany;

async function waitClient(maxMs = 3000) {
const start = Date.now();
while ((!client || !client.auth) && Date.now() - start < maxMs) {
await new Promise((r) => setTimeout(r, 50));
}
return client;
}

const supabase = await waitClient();
if (!supabase || !supabase.auth) {
alert(“Erro: supabase client não carregado.”);
return;
}

const email = $state.email;
const password = $state.password;
const confirm = $state.confirmpassword;
if (!email || !password || !confirm) {
alert(“Please fill all fields”);
return;
}
if (password !== confirm) {
alert(“Passwords do not match”);
return;
}

const { data, error } = await supabase.auth.signUp({
email,
password,
});

if (error) {
alert("Account creation failed: " + error.message);
return;
}

window.location.href = “/c-code-verification-create-account”;
})();

Hello @carlos_eduardo I was unable to reproduce the issue with the details you shared - I was able to access the form initial and current state inside a run code action. Please share project id and exactly the steps to reproduce the issue for further help.