We have existing labels (B1, A10, B20, etc. )(Picture 1). When the user clicks a button in Pic 1, we want the combo box #2 on a separate screen (Pic 2) to populate with the label value in the same container as the button.
5 labels, 5 buttons next to it, one label equals one button. Combo box #2 has two properties: name and description.
Also, when we try to submit this information, the Patch function does not work because of an error saying it requires a Record instead of Text values.
Code below: (table name redacted)
Thanks for the reply. It worked until referencing the label to the combo box. My combo box has two fields, and I'm trying to create an empty record and patch the column with the name, area name, ..., but I have errors with 'Audit Area'. I tried using selected items as well with no luck.
Error - "The type of this argument 'Audit Area' does not match the expected type 'Record'. Found type 'Table'. The function 'Patch' has some invalid arguments."
TIA
Hi @gadamcz
If you want Combo box #2 to be populated when specific buttons are clicked in the gallery, use a collection.
In the OnVisible property of the screen that contains the gallery:
Clear(col_SelectedRecs);
In the OnSelect property of the button in the gallery:
Collect(
col_SelectedRecs,
{
Name: ThisItem.X,
Description: "Whatever you want"
}
)
Where X is the value used to display B1, A10 etc
In Combo box #2 in the the other screen, the DefaultSelectedItems property is:
col_SelectedRecs
You're going to need additional logic to stop the user from clicking the same button twice in your gallery.
You should really ask your 2nd question in a separate post because it will be easier for members to find the solution to both of your questions if posted separately.
If this doesn't work, please post the 2nd part separately. Change the patch for 'Audit Area' to:
cmbAuditArea1.SelectedItems
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional