Skip to content

Conversation

@JamesHutchison
Copy link
Owner

@JamesHutchison JamesHutchison commented Apr 18, 2024

Add's element ID to the response returned to the server

It allows for logic like this:

def get_input_by_id(e: dict, input_id: str) -> dict:
    for input in e["target"]["elements"]:
        if input.get("id") == input_id:
            return input
    raise Exception(f"Input not found: {input_id}")

Currently, inputs can only be grabbed by their index which is brittle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants