{"app":{"id":21,"summary":"Dynamic Form Example","versions":[70],"created_by":"henri186","created_at":"2023-12-28T13:15:17.603Z","votes":0,"approved":false,"apps":["supabase,","gmail,","slack"],"app_type":"openapp","external_embed_url":null,"value":{"css":{"buttoncomponent":{"button":{"class":"","style":""},"container":{"class":"","style":""}}},"grid":[{"3":{"h":8,"w":2,"x":0,"y":0,"fixed":false},"12":{"h":11,"w":9,"x":2,"y":1,"id":"a","fixed":false},"id":"a","data":{"id":"a","type":"decisiontreecomponent","nodes":[{"id":"a","next":[{"id":"b","condition":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}}],"label":"Credentials","allowed":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}},{"id":"b","next":[{"id":"c","condition":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}}],"label":"Contact","allowed":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}},{"id":"c","next":[{"id":"f","condition":{"expr":"f.result > 5","type":"evalv2","fieldType":"boolean","connections":[{"id":"result","componentId":"f"}]}},{"id":"e","condition":{"expr":"f.result <= 5","type":"evalv2","fieldType":"boolean","connections":[{"id":"result","componentId":"f"}]}}],"label":"Feedback","allowed":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}},{"id":"d","next":[],"label":"d","allowed":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}},{"id":"e","next":[{"id":"d","condition":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}}],"label":"Not happy","allowed":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}},{"id":"f","next":[{"id":"d","condition":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}}],"label":"Happy","allowed":{"expr":"true","type":"evalv2","fieldType":"boolean","connections":[]}}],"customCss":{"container":{"class":"","style":""}},"configuration":{},"numberOfSubgrids":6}}],"theme":{"path":"f/app_themes/theme_0","type":"path"},"subgrids":{"a-0":[{"3":{"h":8,"w":3,"x":0,"y":0,"fixed":false},"12":{"h":9,"w":12,"x":0,"y":0,"id":"b","fixed":false},"id":"b","data":{"id":"b","type":"schemaformcomponent","customCss":{"label":{"class":"","style":""},"container":{"class":"","style":""},"description":{"class":"","style":""}},"configuration":{"largeGap":{"type":"static","value":false},"displayType":{"type":"static","value":false}},"componentInput":{"type":"static","value":{"order":["first_name","City"],"required":[],"properties":{"City":{"type":"string","default":"","description":"Where do you live"},"first_name":{"type":"string","default":"","description":"your name"}}},"fieldType":"schema"}}}],"a-1":[{"3":{"h":8,"w":3,"x":0,"y":0,"fixed":false},"12":{"h":6,"w":12,"x":0,"y":0,"id":"c","fixed":false},"id":"c","data":{"id":"c","type":"schemaformcomponent","customCss":{"label":{"class":"","style":""},"container":{"class":"","style":""},"description":{"class":"","style":""}},"configuration":{"largeGap":{"type":"static","value":false},"displayType":{"type":"static","value":false}},"componentInput":{"type":"static","value":{"order":["Email","Contact"],"required":[],"properties":{"Email":{"type":"string","format":"email","default":"","pattern":"^[\\w-.]+@([\\w-]+\\.)+[\\w-]{2,4}$","description":""},"Contact":{"enum":["Email","Slack"],"type":"string","default":"","description":"How should we get in touch?"}}},"fieldType":"schema"}}},{"3":{"h":1,"w":1,"x":0,"y":8,"fixed":false},"12":{"h":1,"w":4,"x":4,"y":6,"id":"d","fixed":false},"id":"d","data":{"id":"d","type":"buttoncomponent","customCss":{"button":{"class":"","style":""},"container":{"class":"","style":""}},"recomputeIds":[],"configuration":{"size":{"type":"static","value":"xs"},"color":{"type":"static","value":"dark"},"label":{"type":"static","value":"Send test"},"onError":{"type":"oneOf","selected":"errorOverlay","configuration":{"open":{"id":{"type":"static","value":""}},"close":{"id":{"type":"static","value":""}},"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"errorOverlay":{},"sendErrorToast":{"message":{"type":"static","value":""},"appendError":{"type":"static","value":true}}}},"disabled":{"type":"static","value":false},"afterIcon":{"type":"static","value":""},"onSuccess":{"type":"oneOf","selected":"none","configuration":{"none":{},"open":{"id":{"type":"static","value":""}},"close":{"id":{"type":"static","value":""}},"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"sendToast":{"message":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}}}},"beforeIcon":{"type":"static","value":""},"fillContainer":{"type":"static","value":false},"triggerOnAppLoad":{"type":"static","value":false}},"componentInput":{"type":"runnable","fields":{"email":{"expr":"c.values.Email","type":"evalv2","value":"","format":"","fieldType":"string","connections":[{"id":"values","componentId":"c"}]},"method":{"expr":"c.values.Contact","type":"evalv2","value":"","format":"","fieldType":"string","connections":[{"id":"values","componentId":"c"}]}},"runnable":{"name":"u/henri/contact_method","path":"u/henri/contact_method","type":"runnableByPath","schema":{"type":"object","order":["email","method"],"$schema":"https://json-schema.org/draft/2020-12/schema","required":[],"properties":{"email":{"type":"string","format":"","default":"","description":""},"method":{"type":"string","format":"","default":"","description":""}}},"runType":"flow"},"fieldType":"any","autoRefresh":false,"recomputeOnInputChanged":false},"verticalAlignment":"center","horizontalAlignment":"center"}}],"a-2":[{"3":{"h":1,"w":1,"x":0,"y":0,"fixed":false},"12":{"h":2,"w":8,"x":2,"y":1,"id":"e","fixed":false},"id":"e","data":{"id":"e","type":"textcomponent","customCss":{"text":{"class":"","style":""},"container":{"class":"","style":""}},"configuration":{"style":{"type":"static","value":"Body"},"tooltip":{"type":"static","value":""},"copyButton":{"type":"static","value":false}},"componentInput":{"eval":"How did you like the experience?","type":"templatev2","value":"Hello ${ctx.username}","fieldType":"template","connections":[]},"verticalAlignment":"top","horizontalAlignment":"center"}},{"3":{"h":1,"w":3,"x":0,"y":1,"fixed":false},"12":{"h":2,"w":8,"x":2,"y":4,"id":"f","fixed":false},"id":"f","data":{"id":"f","type":"slidercomponent","customCss":{"bar":{"class":"","style":""},"value":{"class":"","style":""},"handle":{"class":"","style":""},"limits":{"class":"","style":""}},"configuration":{"max":{"type":"static","value":10},"min":{"type":"static","value":0},"step":{"type":"static","value":1},"vertical":{"type":"static","value":false},"defaultValue":{"type":"static","value":5}},"verticalAlignment":"center"}}],"a-3":[{"3":{"h":1,"w":1,"x":0,"y":0,"fixed":false},"12":{"h":1,"w":8,"x":2,"y":1,"id":"i","fixed":false},"id":"i","data":{"id":"i","type":"textcomponent","customCss":{"text":{"class":"","style":""},"container":{"class":"","style":""}},"configuration":{"style":{"type":"static","value":"Body"},"tooltip":{"type":"static","value":""},"copyButton":{"type":"static","value":false}},"componentInput":{"eval":"Thanks for your time, do not forget to submit :)","type":"templatev2","value":"Hello ${ctx.username}","fieldType":"template","connections":[]},"verticalAlignment":"top","horizontalAlignment":"left"}},{"3":{"h":1,"w":1,"x":1,"y":0,"fixed":false},"12":{"h":1,"w":2,"x":5,"y":4,"id":"j","fixed":false},"id":"j","data":{"id":"j","type":"buttoncomponent","customCss":{"button":{"class":"","style":""},"container":{"class":"","style":""}},"recomputeIds":[],"configuration":{"size":{"type":"static","value":"xs"},"color":{"type":"static","value":"green"},"label":{"type":"static","value":"Submit"},"onError":{"type":"oneOf","selected":"errorOverlay","configuration":{"open":{"id":{"type":"static","value":""}},"close":{"id":{"type":"static","value":""}},"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"errorOverlay":{},"sendErrorToast":{"message":{"type":"static","value":""},"appendError":{"type":"static","value":true}}}},"disabled":{"type":"static","value":false},"afterIcon":{"type":"static","value":""},"onSuccess":{"type":"oneOf","selected":"none","configuration":{"none":{},"open":{"id":{"type":"static","value":""}},"close":{"id":{"type":"static","value":""}},"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"sendToast":{"message":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}}}},"beforeIcon":{"type":"static","value":""},"fillContainer":{"type":"static","value":false},"triggerOnAppLoad":{"type":"static","value":false}},"componentInput":{"type":"runnable","fields":{"rowData":{"expr":"{\n  \"name\": b.values.first_name,\n  \"city\": b.values.City,\n  \"email\": c.values.Email,\n  \"contact\": c.values.Contact,\n  \"rating\": f.result,\n  \"feedback\": bg_0.result\n}","type":"evalv2","value":null,"format":"resource-record","fieldType":"object","connections":[]},"tableName":{"type":"static","value":"user_form","fieldType":"string"},"supabaseResource":{"type":"static","value":"$res:u/henri/wm_showcases_supabase","format":"resource-supabase","fieldType":"object"}},"runnable":{"name":"Inline Script 0","type":"runnableByName","inlineScript":{"lock":"{\n  \"version\": \"3\",\n  \"packages\": {\n    \"specifiers\": {\n      \"npm:@supabase/supabase-js\": \"npm:@supabase/supabase-js@2.39.1\"\n    },\n    \"npm\": {\n      \"@supabase/functions-js@2.1.5\": {\n        \"integrity\": \"sha512-BNzC5XhCzzCaggJ8s53DP+WeHHGT/NfTsx2wUSSGKR2/ikLFQTBCDzMvGz/PxYMqRko/LwncQtKXGOYp1PkPaw==\",\n        \"dependencies\": {\n          \"@supabase/node-fetch\": \"@supabase/node-fetch@2.6.15\"\n        }\n      },\n      \"@supabase/gotrue-js@2.62.0\": {\n        \"integrity\": \"sha512-4eBuZNXGOk7ewqJuHPYMnk8clCtEx6Hfnu6yHLjZlx7w18TqcojcTRUBZagErtpgwwdfzUwKbquexhbrpH/ysw==\",\n        \"dependencies\": {\n          \"@supabase/node-fetch\": \"@supabase/node-fetch@2.6.15\"\n        }\n      },\n      \"@supabase/node-fetch@2.6.15\": {\n        \"integrity\": \"sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==\",\n        \"dependencies\": {\n          \"whatwg-url\": \"whatwg-url@5.0.0\"\n        }\n      },\n      \"@supabase/postgrest-js@1.9.0\": {\n        \"integrity\": \"sha512-axP6cU69jDrLbfihJKQ6vU27tklD0gzb9idkMN363MtTXeJVt5DQNT3JnJ58JVNBdL74hgm26rAsFNvHk+tnSw==\",\n        \"dependencies\": {\n          \"@supabase/node-fetch\": \"@supabase/node-fetch@2.6.15\"\n        }\n      },\n      \"@supabase/realtime-js@2.9.1\": {\n        \"integrity\": \"sha512-OxmY2qj+y6+KI4ifTL92j5+WYP+u5/PdThlYxVb0GMcMiMHfA7yIku9yaQNC5/oRdIvhuRpTMG/8/R40eB+8pA==\",\n        \"dependencies\": {\n          \"@supabase/node-fetch\": \"@supabase/node-fetch@2.6.15\",\n          \"@types/phoenix\": \"@types/phoenix@1.6.4\",\n          \"ws\": \"ws@8.16.0\"\n        }\n      },\n      \"@supabase/storage-js@2.5.5\": {\n        \"integrity\": \"sha512-OpLoDRjFwClwc2cjTJZG8XviTiQH4Ik8sCiMK5v7et0MDu2QlXjCAW3ljxJB5+z/KazdMOTnySi+hysxWUPu3w==\",\n        \"dependencies\": {\n          \"@supabase/node-fetch\": \"@supabase/node-fetch@2.6.15\"\n        }\n      },\n      \"@supabase/supabase-js@2.39.1\": {\n        \"integrity\": \"sha512-nz0aQPButJWjChX+bLXqvhHutfiOuiJwzibyJs0uhFrQ6JRDZZsl9+nX2jgyox2v2V+e4PEwbn/eaEOFVUr8iA==\",\n        \"dependencies\": {\n          \"@supabase/functions-js\": \"@supabase/functions-js@2.1.5\",\n          \"@supabase/gotrue-js\": \"@supabase/gotrue-js@2.62.0\",\n          \"@supabase/node-fetch\": \"@supabase/node-fetch@2.6.15\",\n          \"@supabase/postgrest-js\": \"@supabase/postgrest-js@1.9.0\",\n          \"@supabase/realtime-js\": \"@supabase/realtime-js@2.9.1\",\n          \"@supabase/storage-js\": \"@supabase/storage-js@2.5.5\"\n        }\n      },\n      \"@types/phoenix@1.6.4\": {\n        \"integrity\": \"sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==\",\n        \"dependencies\": {}\n      },\n      \"tr46@0.0.3\": {\n        \"integrity\": \"sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==\",\n        \"dependencies\": {}\n      },\n      \"webidl-conversions@3.0.1\": {\n        \"integrity\": \"sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==\",\n        \"dependencies\": {}\n      },\n      \"whatwg-url@5.0.0\": {\n        \"integrity\": \"sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==\",\n        \"dependencies\": {\n          \"tr46\": \"tr46@0.0.3\",\n          \"webidl-conversions\": \"webidl-conversions@3.0.1\"\n        }\n      },\n      \"ws@8.16.0\": {\n        \"integrity\": \"sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==\",\n        \"dependencies\": {}\n      }\n    }\n  },\n  \"remote\": {}\n}\n","path":"u/henri/newapp/Inline_Script_0","schema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["supabaseResource","tableName","rowData"],"properties":{"rowData":{"type":"object","format":"resource-record","default":null,"description":""},"tableName":{"type":"string","default":null,"description":""},"supabaseResource":{"type":"object","format":"resource-supabase","default":null,"description":""}}},"content":"import { createClient } from \"npm:@supabase/supabase-js\";\n\n// Define the Supabase resource type as specified\ntype Supabase = {\n  key: string;\n  url: string;\n};\n\nexport async function main(\n  supabaseResource: Supabase,\n  tableName: string,\n  rowData: Record<string, any>,\n) {\n  // Initialize the Supabase client\n  const supabase = createClient(supabaseResource.url, supabaseResource.key);\n\n  // Insert a row into the specified table\n  const { data, error } = await supabase\n    .from(tableName)\n    .insert([rowData]);\n\n  // Return the result or throw an error if the operation failed\n  if (error) {\n    throw error;\n  }\n\n  return data;\n}\n","language":"deno"}},"fieldType":"any","autoRefresh":false,"recomputeOnInputChanged":false},"verticalAlignment":"center","horizontalAlignment":"center"}}],"a-4":[{"3":{"h":8,"w":3,"x":0,"y":0,"fixed":false},"12":{"h":8,"w":12,"x":0,"y":0,"id":"g","fixed":false},"id":"h","data":{"id":"h","type":"schemaformcomponent","customCss":{"label":{"class":"","style":""},"container":{"class":"","style":""},"description":{"class":"","style":""}},"configuration":{"largeGap":{"type":"static","value":false},"displayType":{"type":"static","value":false}},"componentInput":{"type":"static","value":{"order":["Feedback"],"required":[],"properties":{"Feedback":{"type":"string","default":"","description":"Where could we improve?"}}},"fieldType":"schema"}}}],"a-5":[{"3":{"h":8,"w":3,"x":0,"y":0,"fixed":false},"12":{"h":8,"w":12,"x":0,"y":0,"id":"g","fixed":false},"id":"g","data":{"id":"g","type":"schemaformcomponent","customCss":{"label":{"class":"","style":""},"container":{"class":"","style":""},"description":{"class":"","style":""}},"configuration":{"largeGap":{"type":"static","value":false},"displayType":{"type":"static","value":false}},"componentInput":{"type":"static","value":{"order":["Feedback"],"required":[],"properties":{"Feedback":{"type":"string","default":"","description":"What did you like the most?"}}},"fieldType":"schema"}}}]},"fullscreen":false,"norefreshbar":false,"hiddenInlineScripts":[{"name":"Background Runnable 0","type":"runnableByName","fields":{"negative":{"expr":"h.values.Feedback","type":"evalv2","value":null,"fieldType":"object","connections":[{"id":"values","componentId":"h"}]},"positive":{"expr":"g.values.Feedback","type":"evalv2","value":null,"fieldType":"object","connections":[{"id":"values","componentId":"g"}]}},"autoRefresh":true,"inlineScript":{"lock":"","path":"u/henri/newapp/Background_Runnable_0","schema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":[],"properties":{"negative":{"type":"object","default":null,"description":""},"positive":{"type":"object","default":null,"description":""}}},"content":"from typing import Optional, TypedDict\n\n\n# Define the main function with optional parameters 'positive' and 'negative'\ndef main(positive: Optional[str] = None, negative: Optional[str] = None) -> str:\n    # Check if both 'positive' and 'negative' are provided\n    if positive and negative:\n        return f\"{positive}.{negative}\"\n    # Return 'positive' if only 'positive' is provided\n    elif positive:\n        return positive\n    # Return 'negative' if only 'negative' is provided\n    elif negative:\n        return negative\n    # Return an empty string if neither is provided\n    else:\n        return \"\"\n","language":"python3"},"recomputeIds":[],"noBackendValue":"","recomputeOnInputChanged":true}],"unusedInlineScripts":[]},"description":"Example of a Typeform-like dynamic form made with Windmill. Tutorial at https://www.youtube.com/watch?v=MTGZTO1AduM","vcreated_at":"2023-12-28T13:15:17.603Z","vcreated_by":"henri186","comments":[]}}