Hi All,
I have a gallery where a check box and combo box is there. When check box is selected that respective value loads in the Combo box. For Ex. (If the check box value is design then combo box value has 3 items and If the check box value is development then combo box value has 1 items).
When + icon is clicked I want to load rows in gallery based on the check box selected and the items in the combo box. For Eg. (if check box value selected value is design & development then the combo box will be having total of 4 values. So 4 rows must be added in the gallery).
The code now written in the + icon is:
Collect(colFinalPhase,Patch, Patch(varNewPhaserecord,{ID: vartest, 'Project Name': prjnames_3.Selected.ProjectName}));
I need to load the rows in this gallery which has collection name as colFinalPhase which is above.
This vartest is a set variable to collect the number of checkbox collected in the gallery.
Set(vartest, CountRows(Filter(Gallery2.AllItems,Checkbox2.Value = true)));
Any idea/suggestion how this can be implemented.
whatever code I have given in the checkbox I have attached in the screenshot. The code in the Add row icon is
ForAll(ComboBox6.SelectedItems As C,Collect(colFinalPhase,{Phase:Title2.Text,'Work product':Table(C)}));
In the colFinalPhase gallery the Phase and Work Product dropdown Items are attached in screenshot.
This Table C where should I give it?
Hi @Uthhra ,
Could you please show me the code in your check box now and the Items of your Combo box and dropdown?
Best regards,
Rimmon Li
Yeah Phase and Work Product in colFinalPhase gallery are dropdown. When checkbox is selected Phase is getting displayed but the Combo box values are not getting displayed in the colFinalPhase gallery when row is added.
Hi @Uthhra ,
Are controls in Phase and Work product dropdown? If you want to add rows when the check box is selected, please try this:
I assuming they are dropdown.
Set the OnCheck of check box:
ForAll(ComboBox.SelectedItems As C,Collect(colFinalPhase,{Phase:Checkbox6.Text,'Work product':Table(C)}))
The result of my test:
After selecting the "4".
Hope this helps you!
-----------------------------------------------------------------------------------------------------------------------------------
If my answer solves your problem, please accept it as a solution to help more people stuck on the same problem find it.
Best regards,
Rimmon Li
In the above checkbox gallery which ever check box is selected that respective checkbox and combo box items must be added to the below gallery where there are two columns called Phase and Work product. When the row is added these details must also be added to the below colFinalPhase gallery.
The check box gallery gets the values from different list and the items of the gallery is
Distinct(Phasenames,Phase)
Hi @Uthhra ,
What does "display" mean? Do you want to use a function like Patch to save Combo box's options to a column in colFinalPhase collection?
Best regards,
Rimmon Li
It is working now. But whatever is selected in the checkbox gallery. How to display the values in the colFinalPhase gallery. For Ex. The value Onboarding must display in the Phase column of the colFinalPhase and combo box selected items must display on the Work Product column in colFinalPhase. Is there a way to do it?
Hi @Uthhra ,
Set is a behavior function, you can't put it on the Items property, you should put it on a property like OnSelect, and the property that can put the behavior function is usually on the button, such as button, check box, etc.
Hope this helps you!
-----------------------------------------------------------------------------------------------------------------------------------
If my answer solves your problem, please accept it as a solution to help more people stuck on the same problem find it.
Best regards,
Rimmon Li
If I use Set variable in Items of combo box. I'm getting an error, "Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app".
Hi @Uthhra ,
Do you want to create this number of rows into the collection after getting the total number of options for Combo box with a value of true checkbox in the gallery? Please try this:
1)Set the variable to get total number of combo box Items:
Set(contR,0);
The property of check box in gallery:
OnCheck:Set(contR,Sum(CountRows(ComboBox.SelectedItems),contR));
OnUncheck:If(contR>0,Set(contR,contR-CountRows(ComboBox.SelectedItems)))
2)The property of button:
ForAll(Sequence(contR), Collect(colFinalPhase,{ID:expectedValue1,'Project Name':expectedValue2}))
Hope this helps you!
-----------------------------------------------------------------------------------------------------------------------------------
If my answer solves your problem, please accept it as a solution to help more people stuck on the same problem find it.
Best regards,
Rimmon Li
WarrenBelz
146,631
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,991
Most Valuable Professional