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

Pre-Select Checkbox when i get data from Infinity datasource #443

Closed
skynet-05 opened this issue Jul 10, 2024 · 4 comments · Fixed by #455, VolkovLabs/volkovlabs.io#723 or #474
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@skynet-05
Copy link

skynet-05 commented Jul 10, 2024

Considering this my response

[
	{
		"value": "12345",
		"label": "foo",
		"isChecked": true
	},
	...
]

Im using the form element: "Checkbox list with custom options"
How do i pre-check the boxes as the data is fetched?

@mikhail-vl mikhail-vl added the question Further information is requested label Jul 10, 2024
@mikhail-vl mikhail-vl moved this to Ready in Business Suite Jul 10, 2024
@mikhail-vl mikhail-vl added this to the Forms 4.2.0 milestone Jul 10, 2024
@vitPinchuk
Copy link
Contributor

@skynet-05 Thank you for your question

Are you having an issue with the initial value for the Checkbox list with custom options?
Do you set the initial value but it doesn't work for your Checkbox list?
We fixed that in a similar issue #428 and #435
It should work correctly from version 4.1.0

Or are you trying to figure out how to set the initial value for Checkbox list using the Infinity data source as a whole?

Thank you.

@vitPinchuk vitPinchuk moved this from Ready to In progress in Business Suite Jul 12, 2024
@skynet-05
Copy link
Author

No, I'm able to see the checkboxes once the data is fetched from the datasource but is there an option to automatically select the checkboxes when for certain is mapped as checked = true

Considering this my response

[
	{
		"value": "12345",
		"label": "foo",
		"isChecked": true
	},
	...
]

Im using the form element: "Checkbox list with custom options" How do i pre-check the boxes as the data is fetched?

if my data sends isChecked = true I want this particular value to be preselected, so that i can have an option to unselect and update the values.

@mikhail-vl mikhail-vl added enhancement New feature or request and removed question Further information is requested labels Jul 16, 2024
@vitPinchuk
Copy link
Contributor

@skynet-05 Thank you for your question and the detailed information.

We have added a few updates to our documentation to clarify moments related to setting initial values and mapping them to form elements.
The updates will be available shortly.

We have added some changes to our panel. The Field and Query Field (Query) fields will be placed in the Initial Query section in the options. The updates will be available since 4.2.0 version.

Basic issue. To set initial values via Infinity Data source and another type of data source, please, use Query Field option in element. Please select Initial Action to Query, after that Select a field from the Query response and it should automatically preselect values.

Initial Action Section
image

Query Fields
image

@github-project-automation github-project-automation bot moved this from In progress to Done in Business Suite Jul 17, 2024
@skynet-05
Copy link
Author

Hey,
Thank you for your update regarding this.
I'm still facing few issue w.r.t. this. Let me reiterate the issue again.

[
	{
		"_id": "12345",
		"lable": "foo",
		"isChecked": true
	},
    {
		"_id": "123456",
		"label": "foo",
		"isChecked": false
	},
	...
]

Considering the above response from my API using infinity plugin
This is what i see in my panel

image
and below are the configurations

image

image

But with the above configurations, for the initial checkbox selections its only pre selecting the last ones

Current version of Business Form is 4.3.1

Do let me know if I have to update the way i send API response or i misconfigured something

Thank you :)

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