Hi Everyone,
I have a Gallery which contains a CheckBox, TextInput(holds Name) and DropDown(holds the Status) in each of its rows.
Also I have a button called "New" in my App which when pressed will create a new record in the Gallery with default empty values using below code:
(ccProjects is a collection created in the App using a SharePoint list and is set as the DataSource for the Gallery)
Patch(ccProjects, Defaults(ccProjects),
{
'Name (Title)': "",
Status: {Value: ""}
}
)
I need to get this record from the Gallery and mark its checkbox as checked when the New button is clicked. Can anyone please help me out here?
Solved! Go to Solution.
Hi @sgokul95 ,
Since you are wanting to change the check box value inside the Gallery with the button outside, please consider using AddColumns function to add a new column when creating the collection.
ClearCollect(ccProjects, AddColumns(...., "Check", false))
OnSelect of the create button:
Set(varNEW, Patch(ccProjects, Defaults(ccProjects),
{
'Name (Title)': "",
Status: {Value: ""},
Check: true
}
)
)
This variable is exact the new created record.
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hey! When you click a button, set a var
Set(varCheckBox; true)
In the Checkbox, set the default to be the varCheckBox
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
Check my User Group (pt-PT)!
Last Post on Community
Hi @Nogueira1306 ,
Thanks for your quick reply.
The New button is not present in each row of the Gallery. It is present outside the Gallery.
So when I created and set the varCheckBox in the "New" button in my App and then set the varCheckBox to the Default property of the CheckBox, the CheckBox in each of the row becomes "Checked" instead of the particular new record that I had created.
Ok.. Try to check your data source to check if it is already created.
Something like this:
If(CountRows(Filter('DataSource', ID = ThisItem.ID)) >= 1, true, false)
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
Check my User Group (pt-PT)!
Last Post on Community
Hi @sgokul95 ,
Since you are wanting to change the check box value inside the Gallery with the button outside, please consider using AddColumns function to add a new column when creating the collection.
ClearCollect(ccProjects, AddColumns(...., "Check", false))
OnSelect of the create button:
Set(varNEW, Patch(ccProjects, Defaults(ccProjects),
{
'Name (Title)': "",
Status: {Value: ""},
Check: true
}
)
)
This variable is exact the new created record.
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.