cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shnurich
Helper III
Helper III

Default Selected items Dont save with Patch

Hi 

I have custom powerapps form, 

Combobox named DataCardValue1
Items: Filter('Brand';Title=DataCardValue10.Selected.Value)
DefaultSelectedItems: Parent.Default

Update of card of DataCardValue1:


ForAll(DataCardValue1.SelectedItems;{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id: 1;
Value: Text
})

 

And when user open a form, we can see default values, but after Patching this field is empty.
and when I create a label with: Concat(DataCardValue1.SelectedItems;Text) it also empty but I can see a value inside 😞


How to fix it?

 

3 REPLIES 3
RandyHayes
Super User
Super User

@shnurich 

Firstly, if you are using a Form, then you should not be using Patch.  Your form should be submitted with a SubmitForm function.

 

I am assuming that the underlying column of your datacard is a Lookup column as you are providing an Id and a Value - which is only needed for a Lookup column.

 

Your DataCardValue1 control Items property should be (as you have):

    Filter(Brand; Title=DataCardValue10.Selected.Value)

 

Now, the question is...do you have a Text column in your record?  You are referencing that in your Update property.

You need to reference the column that your Lookup is defined for.  Typically, that is Title.

So, your Update property would be:

ForAll(DataCardValue1.SelectedItems;
   {
      Id: ID;
      Value: Title
   }
)

 

If your underlying column is NOT a lookup, please provide what type it is.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

thanks, but it didn't help.
The default value is not saved unless it is reselected.

The value is looked up in the Brands table, where there are two columns, Title and Text.

RandyHayes
Super User
Super User

@shnurich 

Can you provide some more detail on your response?  Specifically, how is your Lookup column defined in your list? 

What is your Default property formula?  What is the Update property of the Datacard?  Perhaps a screenshot of what you might be seeing or not seeing as well.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,335)