Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement create_submission built in event hook behavior #342

Closed
signebedi opened this issue Sep 3, 2024 · 2 comments
Closed

Implement create_submission built in event hook behavior #342

signebedi opened this issue Sep 3, 2024 · 2 comments

Comments

@signebedi
Copy link
Owner

This will look something like:

create_submission:
  form_name: example_form
  values:
    field_name_1:
      method: static
      value: "This text will always be the same"
    field_name_2:
      method: from_field
      value: some_field_name
    field_name_3:
      method: from_field
      value: __metadata__some_metadata_field

This will create an example_form form submission with the values set in the values dict. Should we support setting metadata fields too, just using the __metadata__ field name prefix in the values dict keys?

Originally posted by @signebedi in #210 (comment)

@signebedi
Copy link
Owner Author

signebedi commented Sep 5, 2024

Opted against setting metadata fields in the new target form, except for the created_by field which is done by default. We may want to revisit this decision in the future... the logic change is very straightforward if we want to add something to parse target __metadata__ fields and append these to the metadata dict...

@signebedi
Copy link
Owner Author

We should consider running the data through the pydantic model... there are pros and cons, but it will help enforce consistency and prevent breaking...

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

No branches or pull requests

1 participant