cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JR-BejeweledOne
Level: Powered On

Patching a Collection

In my app, I have created a blank collection  as so:

ClearCollect(HolidayCollection,{Country: "", Name: "", StartDate: "", EndDate: "", HalfDay: ""})

 

What I want to do is to patch the collection with data from other controls (dropdowns, text inputs etc.) for use later in the app.

 

When I configure the patch intellisense *appears* to accept everything, however when I click the button to test, I get an error that the data source supplied to the function is invalid.

 

patch1.png

 

Is it not possible to patch data from other controls in the app into a collection?

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Level: Powered On

Re: Patching a Collection

The initial collect for the blank record is happening in another place.   This part is for patching a collection that's being used in a gallery control.

 

I figured out where the issue was.   One of the values wasn't in the correct format.

4 REPLIES 4
NP1
Level: Powered On

Re: Patching a Collection

You have to use Collect to add data to a collection.
ulisesrc
Level: Powered On

Re: Patching a Collection

----------------

 

Use: Name: Text(item1) 

 ***It works great 

Text(item1) 

 

datamaster
Level 8

Re: Patching a Collection

@JR-BejeweledOne As @NP1  mentioned you have to to a collect to add a record to a collection. If you want to update the first blank record then first check if you have a blank record and then use something like this to update that record:

UpdateIf(
HolidayCollection,
Name = "",
{
Country: "USA",
Name: TextInput1.Text,
StartDate: "",
EndDate: "",
HalfDay: ""
}
)

 

------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------
If this post helps answer your question, please click on
“Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up.

JR-BejeweledOne
Level: Powered On

Re: Patching a Collection

The initial collect for the blank record is happening in another place.   This part is for patching a collection that's being used in a gallery control.

 

I figured out where the issue was.   One of the values wasn't in the correct format.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 429 members 4,705 guests
Please welcome our newest community members: