cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TamasMolnar
Level: Power Up

Keep previously selected items in DataCard

Hi Everyone,

 

I have a following issue. I created an app, where we collect some information about our partners. It works fine except one thing...

When I create a new partner, and add related informations, some of these work in a following way:

I have a datacard, and a listbox. When I select a pre-stored item from this listbox, it writes in datacard. After submit it, selected items will be stored. 

 

Here is the detail screen, and at the first time selected items:

image.png

 

But! When I want to edit this partner's card, and go back to edit screen, all selected items reset in datacard, and after re-submitting it stores only the new items, and doesn't keep the old items. 

 

Same on my edit screen, after openning this stored parnter's form to edit. Here I lose my previously selected items, and after submit, I can see only the new items. (of course if I select any...) 

 

image.png

 

Here you can see the related function on default field

 

image.png

 

Question: How should I modify this function to ensure the opportunity for my users to add new items, but keep the old one too?Smiley Happy

 

Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Keep previously selected items in DataCard

Hi @TamasMolnar ,

Could you please share a bit more about your data source?

Could you please share a bit more about the "Automarka" column in your data source? Is it a Text type column?

Further, do you want to select multiple values within the ListBox, and when you edit an existing record, the multiple previous selected values would also be selected within the List Box?

 

I assume that the "Automarka" column is a Text type column in your data source, is it true? Based on the needs that you mentioned, I afraid that the List Box could not achieve your needs.

You could select multiple values from the List Box control, but you could not set multiple values as Default value within the List Box when you edit an record. The Default property of the List Box is required to provide a Text value rather than a Table value.

 

As an alternative solution, I think the ComboBox control could achieve your needs. I have made a test on my side, please take a try with the following workaround:4.JPG

 

5.JPG

 

6.JPG

Add a ComboBox control (ComboBox1) within the ProjectName Data card (on your side, you should add a ComboBox control within the "Automarka" data card), set the Items property of the ComboBox to following:

["PowerApps", "Power BI", "Microsoft Flow", "ALFA ROMEO", "AUDI", "Azure"]

Set the SelectMultiple property to following:

true

Set the DefaultSelectedItems property of the ComboBox to following:

ForAll(
Filter(Split(ThisItem.ProjectName,","), !IsBlank(Result)),
{
Value: Result
}
)

On your side, you should type:

ForAll(
Filter(Split(ThisItem.Automarka, ","), !IsBlank(Result)),
{
Value: Result
}
)

 

Set the Default proeprty of the original Text Input box (DataCardValue10) to following:

Concat(ComboBox1.SelectedItems, Value & ",")

 

Set the Update property of the ProjectName data card to following:

DataCardValue10.Text

On your side, you should type:

AutomarkaTextBox.Text

Please check the following GIF screenshot for more details:

Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 REPLY 1
Community Support Team
Community Support Team

Re: Keep previously selected items in DataCard

Hi @TamasMolnar ,

Could you please share a bit more about your data source?

Could you please share a bit more about the "Automarka" column in your data source? Is it a Text type column?

Further, do you want to select multiple values within the ListBox, and when you edit an existing record, the multiple previous selected values would also be selected within the List Box?

 

I assume that the "Automarka" column is a Text type column in your data source, is it true? Based on the needs that you mentioned, I afraid that the List Box could not achieve your needs.

You could select multiple values from the List Box control, but you could not set multiple values as Default value within the List Box when you edit an record. The Default property of the List Box is required to provide a Text value rather than a Table value.

 

As an alternative solution, I think the ComboBox control could achieve your needs. I have made a test on my side, please take a try with the following workaround:4.JPG

 

5.JPG

 

6.JPG

Add a ComboBox control (ComboBox1) within the ProjectName Data card (on your side, you should add a ComboBox control within the "Automarka" data card), set the Items property of the ComboBox to following:

["PowerApps", "Power BI", "Microsoft Flow", "ALFA ROMEO", "AUDI", "Azure"]

Set the SelectMultiple property to following:

true

Set the DefaultSelectedItems property of the ComboBox to following:

ForAll(
Filter(Split(ThisItem.ProjectName,","), !IsBlank(Result)),
{
Value: Result
}
)

On your side, you should type:

ForAll(
Filter(Split(ThisItem.Automarka, ","), !IsBlank(Result)),
{
Value: Result
}
)

 

Set the Default proeprty of the original Text Input box (DataCardValue10) to following:

Concat(ComboBox1.SelectedItems, Value & ",")

 

Set the Update property of the ProjectName data card to following:

DataCardValue10.Text

On your side, you should type:

AutomarkaTextBox.Text

Please check the following GIF screenshot for more details:

Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.