I added combobox control inside gallery and then patched the data in collection, data get stored in collection but doesn't show up in gallery, it adds only blank row, for now i have added checkbox but that isn't sufficient. as shown in picture below.
Is there any way i can use combobox inside gallery to save data in collections?
Solved! Go to Solution.
Hi @Anonymous ,
Could you please share a bit more about the formula you typed within the Items property of the ComboBox inside your Gallery?
Do you want to select IncidentGroup value from the ComboBox1 inside your Gallery?
Based on the screenshot that you mentioned, I think it is not necessary to add a ForAll function to achieve your needs. You just need to modify your formula as below:
Patch(
CollIncident,
ThisItem,
{
Id: lblCustomID.Text,
IncidentGroup: ComboBox1.Selected.Value, /* <-- reference value from the ComboBox1 rather than Radio control */
IncidentCategory: txtIncidentCategory.Text,
ShowSaveButtons: false
}
);
If(
EditPressed,
false,
Collect(
CollIncident,
{
Id: "",
IncidentGroup: "",
IncidentCategory: "",
ShowSaveButtons: true
}
)
);
UpdateContext({EditPressed: false});
In addition, if you want the saved IncidentGroup value to be shown up within the ComboBox1, please consider set the DefaultSelectedItems property of the ComboBox1 to following:
{
Value: ThisItem.IncidentGroup
}
If the Items property of the ComboBox1 set to a Distinct(...) formula, please consider modify above formula as below:
{
Result: ThisItem.IncidentGroup
}
Please take a try with above solution, check if the issue is solved.
Best regards,
Hi @Anonymous ,
Do you want to use ComboBox to collect user data, and then patch it into a Collection?
Further, could you please share more details about the Patch formula you used in your app to patch data into a Collection from your Gallery?
I have made a test on my side, and don't have the issue that you mentioned, please take a try with the following workaround:
Set the OnSelect property of the "Submit" button to following:
Clear(CurrentStatusRecords);
ForAll(
Gallery1.AllItems, /* <-- Select all Gallery Items value */
Collect(
CurrentStatusRecords, /* <-- Patch data into this new collection */
{
ProductName: Title2.Text,
Status: ComboBox1.Selected.Value /* <-- Reference ComboBox selected value here directly */
}
)
)
The above formula execution reault as below:
Please consider take a try with above solution, then check if the issue is solved. Also please check if you have typed proper Patch formula and ForAll formula in your app to achieve your needs.
Please also check and see if the response I made within the following thread would help in your scenario:
More details about Patch function and ForAll function, please check the following article:
Best regards,
@v-xida-msft Thank you for the response,
I have combobox inside gallery, and on click of plus (+) button i am trying to submit the item in collection, surprisingly, it adds the item in collection but doesn't show up in control in another row. below is another image
i am using this formula..
Patch(
CollIncident,
ThisItem,
{
Id: lblCustomID.Text,
IncidentGroup: redoIncidentGroup.Selected.Value,
IncidentCategory: txtIncidentCategory.Text,
ShowSaveButtons: false
}
);
If(
EditPressed,
false,
Collect(
CollIncident,
{
Id: "",
IncidentGroup: "",
IncidentCategory: "",
ShowSaveButtons: true
}
)
);
UpdateContext({EditPressed: false});
----------------------------------------------------
Also when i am using the code you suggested is throwing this error
what am i doing wrong here?
Thank you
Hi @Anonymous ,
Could you please share a bit more about the formula you typed within the Items property of the ComboBox inside your Gallery?
Do you want to select IncidentGroup value from the ComboBox1 inside your Gallery?
Based on the screenshot that you mentioned, I think it is not necessary to add a ForAll function to achieve your needs. You just need to modify your formula as below:
Patch(
CollIncident,
ThisItem,
{
Id: lblCustomID.Text,
IncidentGroup: ComboBox1.Selected.Value, /* <-- reference value from the ComboBox1 rather than Radio control */
IncidentCategory: txtIncidentCategory.Text,
ShowSaveButtons: false
}
);
If(
EditPressed,
false,
Collect(
CollIncident,
{
Id: "",
IncidentGroup: "",
IncidentCategory: "",
ShowSaveButtons: true
}
)
);
UpdateContext({EditPressed: false});
In addition, if you want the saved IncidentGroup value to be shown up within the ComboBox1, please consider set the DefaultSelectedItems property of the ComboBox1 to following:
{
Value: ThisItem.IncidentGroup
}
If the Items property of the ComboBox1 set to a Distinct(...) formula, please consider modify above formula as below:
{
Result: ThisItem.IncidentGroup
}
Please take a try with above solution, check if the issue is solved.
Best regards,
User | Count |
---|---|
179 | |
120 | |
87 | |
44 | |
41 |
User | Count |
---|---|
245 | |
156 | |
128 | |
77 | |
73 |