What is the use of Allow TextField in Type and search in vFlow

There is an option in Fieldset in type and search element to allow text field, what is the role of that?

51 Likes

Type-and-search element is ideally used to type and search values from the dropdown and select them. The default behaviour of the Type-and-search element is that it becomes valid only when we select any value from the dropdown (when required validation is added on the element). To allow it as a text field this checkbox needs to be selected.

Allow Text Field property can be used in scenarios where the user wants to save a new value which is not present in the dropdown. In this case the Type-and-search field will act as an Input field along with type and search functionality.

54 Likes

Additionally, there is a related property named Dummy Code which can be used along with Allow Text Field property. Refer the below link for more details

48 Likes

My use case is:
I have a third-party API which returned this kind of response:
[{
“id”: 2,
“slug”: “condimentum.”,
“url”: “https://jsonplaceholder.org/posts/condimentum.”,
“title”: “Quisque non ligula laoreet, volutpat velit cursus, condimentum arcu.”,
“content”: “Ppharetra! Viverra.”,
“image”: “https://dummyimage.com/800x430/08110f/condimentum..png&text=jsonplaceholder.org”,
“thumbnail”: “https://dummyimage.com/200x200/08110f/condimentum..png&text=jsonplaceholder.org”,
“status”: “published”,
“category”: “lorem”,
“publishedAt”: “25/12/2022 13:10:07”,
“updatedAt”: “19/01/2023 08:25:17”,
“userId”: 2
}, {…}, {…}]
and I want to display this record in the Type-and-search element.
How can I achieve this?

8 Likes

@Shubhamkumar1 What exactly needs to be shown in the Type-and-search dropdown?
Any specific key from this response?

47 Likes

@ShraddhaDhoke, I want to show the “title” key in the dropdown.

5 Likes

In vFlow, Type-and-search element shows values in dropdown only when the data is in code-value format.
"title": [{"code": "1", "value": "Quisque non ligula laoreet, volutpat velit cursus, condimentum arcu."}, {"code": "2", "value": "Value2"}]

It will not work with string values as mentioned in the response.

47 Likes

It means if I want to integrate third-party API. That API should return the response in code and value format. Otherwise, we are not able to show values in the dropdown.

6 Likes

@Shubhamkumar1 Yes, absolutely!

46 Likes

Thanks @ShraddhaDhoke for the clarification.

4 Likes