I have a List Box with a bunch of item in it. I would like to be able too have people select one of the item and hit submit and the item they selected will be put into the excel sheet.
Solved! Go to Solution.
Hi @dcayanan ,
Do you want to patch selected item within your List Box into your Excel table?
Based on the needs that you mentioned, I think the Patch function could achieve your needs. Please take a try with the following workaround:
Set the OnSelect property of the "Patch to Excel" button to following:
Patch(Table1, Defaults(Table1),{EmployeeName: ListBox1.Selected.Title})
You may type the following formula:
Patch(
YourExcelTable,
Defaults(YourExcelTable),
{
ExcelColumn1: ListBox1.Selected.Column1,
ExcelColumn2: ListBox1.Selected.Column2,
ExcelColumn3: ListBox1.Selected.Column3,
...
}
)
In addition, if you select multiple items in your List Box, and then want to patch multiple items into your Excel table at the same time, please take a try with the following workaround:
Set the OnSelect property of the "Patch to Excel" button to following:
ForAll(
ListBox1.SelectedItems,
Patch(
YourExcelTable,
Defaults(YourExcelTable),
{
ExcelColumn1: Column1,
ExcelColumn2: Column2,
ExcelColumn3: Column3,
...
}
)
)
Please take a try with above solution, check if the issue is solved.
More details about the Patch function and ForAll function, please check the following article:
Best regards,
Hi @dcayanan
For the list box control set property SelectMultiple to false (since you want user to only select 1 value)
In order to get the data from the list box
Use listBox.Selected.Value
where listBox is the name of your list box control
Watch this video for PowerApps and excel connector
https://www.youtube.com/watch?v=-Z_13J02RPU
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @dcayanan ,
Do you want to patch selected item within your List Box into your Excel table?
Based on the needs that you mentioned, I think the Patch function could achieve your needs. Please take a try with the following workaround:
Set the OnSelect property of the "Patch to Excel" button to following:
Patch(Table1, Defaults(Table1),{EmployeeName: ListBox1.Selected.Title})
You may type the following formula:
Patch(
YourExcelTable,
Defaults(YourExcelTable),
{
ExcelColumn1: ListBox1.Selected.Column1,
ExcelColumn2: ListBox1.Selected.Column2,
ExcelColumn3: ListBox1.Selected.Column3,
...
}
)
In addition, if you select multiple items in your List Box, and then want to patch multiple items into your Excel table at the same time, please take a try with the following workaround:
Set the OnSelect property of the "Patch to Excel" button to following:
ForAll(
ListBox1.SelectedItems,
Patch(
YourExcelTable,
Defaults(YourExcelTable),
{
ExcelColumn1: Column1,
ExcelColumn2: Column2,
ExcelColumn3: Column3,
...
}
)
)
Please take a try with above solution, check if the issue is solved.
More details about the Patch function and ForAll function, please check the following article:
Best regards,
User | Count |
---|---|
252 | |
126 | |
104 | |
50 | |
49 |