I have a SharePoint list named Projects, which in turn has a Listing (ID) and a Benefits column, the latter of which stores multiple lines of text. The DATA collection contains all data pertaining to the selected gallery item on a previous screen. In PowerApps itself, I have a label (lbl_Combo) and a Combo box (combo_Benefits). A button (btn_Save) stores the SelectedItems in the Benefits field:
Patch(
Projects,
First(
Filter(
Projects,
Listing = DATA.Listing
)
),
{
Benefits: Concat(combo_Benefits.SelectedItems, Value&Char(13))
}
)
The Items that combo_Benefits has are:
[
"A",
"B",
"C"
]
The SharePoint list stores the selected items just as I want it to. What's more, lbl_Display, whose Text field is set to
DATA.Benefits
also has no issues.
The issue arises when I want to retrieve the multiline text, split it back into separate entries, and connect those to DefaultSelectedItems. I attempted the following, to no avail:
Split(DATA.Benefits, Char(13))
Appending .Result to the above also provided no help.
How can I have the DefaultSelectedItems display the selected items I have stored in the Benefits column?
For example, Items "A" and "C" are selected and saved to SharePoint. Once combo_Benefits is Reset(), it should have "A" and "C" already selected.
Thanks in advance!
Solved! Go to Solution.
Hi @JanikDriehaus ,
Could you please share a bit more about the DATA collection that you mentioned? Do you use it to store selected item from your Previous Gallery?
Further, do you want to display the saved options within combo_Benefits ComboBox?
Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:
Set the Items property of the combo_Benefits ComboBox to following:
[
"A",
"B",
"C"
]
Set the DefaultSelectedItems property of the combo_Benefits ComboBox to following:
ForAll(
Split(DATA.Benefits, Char(13)),
{
Value: Result
}
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
Here's an approach that works for me:
I would set the Items property of combo_Benefits (a combobox) to
TableColl
TableColl is a collection that is defined as below:
ClearCollect(TableColl, "A", "B", "C")
The text property of a label lbl_Display is set to:
Concat(combo_Benefits.SelectedItems,Value & Char(13))
I then have another combobox for which I am setting the DefaultSelectedItems as:
Filter(TableColl, Text(Value) in Split(lbl_Display.Text, Char(13)))
And this works fine.
The reason Split(DATA.Benefits, Char(13)) this doesn't work is because the last item in this table is a blank value AND the records in this table are not records of your original table (they have the same text but they are not the same records).
Let me know if this works for you.
---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.
Thanks!
Hardit Bhatia
https://thepoweraddict.com
Hi @JanikDriehaus ,
Could you please share a bit more about the DATA collection that you mentioned? Do you use it to store selected item from your Previous Gallery?
Further, do you want to display the saved options within combo_Benefits ComboBox?
Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:
Set the Items property of the combo_Benefits ComboBox to following:
[
"A",
"B",
"C"
]
Set the DefaultSelectedItems property of the combo_Benefits ComboBox to following:
ForAll(
Split(DATA.Benefits, Char(13)),
{
Value: Result
}
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
202 | |
173 | |
62 | |
32 | |
31 |
User | Count |
---|---|
327 | |
268 | |
104 | |
72 | |
56 |