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

Dropdown label and value being available in plain text variable picker fields #2175

Open
jamesmacwhite opened this issue Dec 4, 2024 · 6 comments

Comments

@jamesmacwhite
Copy link
Contributor

What are you trying to do?

When using the variable picker field in context like email notifications, we have a scenario were we want to use a dropdown field but want to select the label and not the value to be displayed in an email notification context.

At the moment the field is available in the picker, but it is defaulting to the value, which is a GUID with no context, given its for an external integration system, where as the label is the front facing friendly value we want to show for human usage.

Would it be possible to allow dropdown fields to provide both the label and value as available to select in a picker?

What's your proposed solution?

Consideration of having the label and value as options in a picker. Given dropdown fields are a single option currently, I guess compatibility needs to be considered, to not break existing setups.

Additional context

No response

@engram-design
Copy link
Member

Yeah, this is on our list to expand the variable picker like this!

In Formie 3, there is a "Email Notification Value" for fields, which might work. But that's set for all instances of using that field in the variable picker.

@jamesmacwhite
Copy link
Contributor Author

Thanks! I checked the field and it appears label is set and default, as I don't remember setting it:

image

The field value is however displayed on email previews and confirmed to be appearing on the actual notifications:

image

@engram-design
Copy link
Member

Hmm, no custom email templates? This is how that variable is determined.

@jamesmacwhite
Copy link
Contributor Author

Not in this specific scenario, the rest of email notifications use MJML, where you can control fields in Twig, so not an issue, but for this specific form it is using the default email notification field with the fields selected from the picker.

@jamesmacwhite
Copy link
Contributor Author

jamesmacwhite commented Dec 4, 2024

I did: dd($this->emailValue === 'label') in the condition and checked the email preview HTTP request it returns false for me, so the condition isn't being met to use the label by the looks of it.

@jamesmacwhite
Copy link
Contributor Author

jamesmacwhite commented Dec 4, 2024

OK weirdly, saving the form with Value set then switching it to Label now appears to trigger the logic to use the label, potentially the form model/settings out of sync or not setting label as a default.

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

No branches or pull requests

2 participants