DeskDirector / UserVoice

Feature request tracker
14 stars 2 forks source link

Include form ID and request type ID in dynamic content request body #658

Closed keison-tang closed 2 years ago

keison-tang commented 2 years ago

I am planning to display dynamic content based on the tags on the form and request type.

Currently, the dynamic content POST request body does not include any information about the form or request type that the statement field is in. This would mean I need to create a specific endpoint for each form I intend to implement this for.

If this information was included, I could then use the same endpoint for all of the forms. When processing the POST request I can then include logic to find the tags.

This may also be useful for dynamic fields as well.

Nness commented 2 years ago

Just to be clear. request type is an optional info. When form is used as inline form, the request type does not exist in that context.

Form ID itself won't bring much help unless you hard code it. If you want to reuse and understand the context, pass form tags would be better in my opinion.

We have two options.

In such case, I think you request may not be optimal. Please think again.

Nness commented 2 years ago

Until we can get an reasonable conclusion this is declined. Declined towards idea of pass request type ID and form ID.

keison-tang commented 2 years ago

Yes fair enough, we can hard code any required information to the query parameters of the dynamic content form field URL. 👍

Nness commented 2 years ago

The tag's use case is for categorize request type or forms. If we have hidden relationship between tag and it's dynamic content, then anyone who can alter form need to aware of that. Include admin, master admin etc. Or any people new who start manage form or request type.

On the other hand, tag's context is for whole form. Use such global level context on an single field is also problematic. Where if anyone want to included multiple dynamic content, which tag is for which field?

The best way of dealing with this is use hard coded parameter on content API. such as following.

https://content-url.com/api/dynamic-content?widget=feature1&widget=feature2&widget=feature3

That way, unless someone modify the field, else the content is very consistent. No accident could alter the dynamic content.

The downside of such approach is user need to aware how to use those parameter when they create dynamic field. But that's same as any other tutorial, the benefit of that is after setup it won't break. Unless the field been modified again.

Nness commented 2 years ago

There are several things we need to consider when we design an functionality.