Form Embedder: An impossibly simple way to add a Google Form to your experience

Sent you a DM containing my form link. Tried to submit a form response, and it claimed it submitted, but nothing was recorded in the form.

Did some troubleshooting with Richez_2Ragz, issue was caused by the question type for variables which returned a HTTP 400 Bad Request:

Since this is a config issue, would it be possible to add this snippet to line 239 in script FormService?

if question.inputType ~= InputType.ShortText and question.inputType ~= InputType.LongText then
	for _, variable in Config.Metadata do
		if question.inputLabel == variable then
			error(`{variable} uses unsupported type {question.inputType}, only ShortText is supported.`)
		end
	end
end

This should help prevent such issues from happening in the future, since itā€™s easily overlooked with many variables

1 Like

bahhhh ok iā€™ll undo it than you

Edit: It has been undone :slight_smile:

:saluting_face: good suggestion.

1 Like

Does it support Microsoft Forms too?

No since Microsoft Forms uses an entirely different API than Google Forms. You would likely need to rewrite a major portion of the script for Microsoft Forms support.

Does it support Sections? Thank you!

nope, sorry!

Fantastic module. Saw this a little over a year ago on X Formerly Twitter, and knew someday weā€™d have to implement this.

Thank you for making the code really cleanly. We need to reimplement the UI with our framework to support interaction with the rest of the UI, so itā€™s really convenient that the sent and received data is so well separated from the UI implementation.

Anyway, while looking through the code, I found a bug in FormScript:349

Unchecking a checked box is not reflected in the response form data. And so

				checkbox.Checked.Changed:Connect(function ()
					checkboxDataEntry.value = option
					ShowValidation:Fire(false)
				end)

should be replaced with

				checkbox.Checked.Changed:Connect(function (checkboxValue)
					checkboxDataEntry.value = if checkboxValue then option else nil
					ShowValidation:Fire(false)
				end)
1 Like

Thanks axis! Updated with the bug fix :smiley: Would love to see yā€™alls form UI when its done!!!

1 Like

Itā€™s going to be worse!

But the buttons will work better for xbox and mobile while being designed for PC!

1 Like

do you have plan to update it to support section?

Hello there, @BitwiseAndrea, Iā€™m not sure this feature is working properly, as Iā€™ve been using this form to create a ā€œCustomer Supportā€ form for people that play my games, and my account got banned for it?

Iā€™m not sure this is intended behaviour and Itā€™s quit concerning that this is happening with an official Roblox Plugin.

Username of the banned account @idelUGC_Games

1 Like

This isnā€™t working for me, it keeps on giving the error HTML not parseable. Make sure your form is Public, and you are only using supported components.

It for sure uses supported components, and im not sure if it is public, if it is private I have no idea how to set it to public:

1 Like

Same thing, it might be a bug since Iā€™m getting the same error.
Edit: Also same thing shows in her test game.

1 Like

Itā€™s either an internal bug on Google Formā€™s API or it is a fail in the code. @BitwiseAndrea

1 Like

Might be Google API, I played some other games with it and it did not work so it probably is a bug that @BitwiseAndrea needs to fix for it to work again.

1 Like

Hi everyone! Sorry about the delay - been busy at work.

Google did a weird thing where they added (pointless? it seems?!) ids somewhere that broke a section of my parser. I updated the module and it should work now!.

Please pull in the latest copy of FormService from the model, or copy from this gist

If youā€™re interested in the diff only and donā€™t want to pull in the whole thing, this is what i changed (all changes in FormService)

local labelledByPattern = "aria%-labelledby=\"(%w+)\""

changed to

local labelledByPattern = "aria%-labelledby=\"([%w%s]+)\""

meaning now it captures not just something like id="i8" but also id="i8 i11"

ā€¦next we have

labelPattern = "id=\"" .. id .. "\".->"
local htmlTag = html:match("<(%w+) [^>]-" .. labelPattern)
labelPattern ..= "(.-)</" .. htmlTag .. ">"

changed to

labelPattern = "id=\"" .. id .. "\".->"
local htmlTag = html:match("<(%w+) [^>]-" .. labelPattern)
if htmlTag == nil then
	warn("Cannot find element matching pattern " .. labelPattern)
	return
end
labelPattern ..= "(.-)</" .. htmlTag .. ">"

and thennnnn

local labelledById = html:match(labelledByPattern)
assertNotNil(labelledById)

is updated to handle multiple ids. I still donā€™t understand why only one of these associated elements is in the DOM when i look at the form so we are operating under the assumption that only one of these associated elements is relevant or visible.

local labelledByIds = html:match(labelledByPattern)
assertNotNil(labelledByIds)
	
-- Recently multiple ids have been attached as labelledBy elements... which is fine
-- but its weird because some aren't even in the DOM. So, we just pick the one we find :) 
local labelledById
for _, id in string.split(labelledByIds, " ") do
	local text = getTextAssociatedWithId(id)
	if text ~= nil then
		question.inputLabel = text
		labelledById = id
		break
	else
		warn("Element not found with id " .. labelledById)
	end
end
assertNotNil(labelledById)

Iā€™m so sorry this isnā€™t set up with proper version control and diffs i just havenā€™t made the time. maybe someday :slight_smile: As always please report any issues you are having! Appreciate the support!

13 Likes

I keep getting this error

Is this with the most recent changes, or do you have an out of date model? I updated it today.

If it is with the most recent changes, iā€™ll need your form ID to debug.

2 Likes