cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SimoneOS
Frequent Visitor

add multiple rows to sharepoint list from Gallery

I have created a forecast app for the sales team

The forecast is stored as a sharepoint list and they can update their forecast using the gallery input

Each value is a new row so needs the customer id and date etc but on the form they complete all the values then press submit to save to the table.

Do i need to create a collection onchange for each value or can i submit all the changes in one go without a collection?

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

Hi @SimoneOS ,

 

In case you always want to create new items for all items in Gallery5, you can use a ForAll function to create them:

ForAll(
	Gallery5.AllItems,
	Patch(
		ForecastList,
		Defaults(ForecastList),
		{Approved:false,
		CustId:LookUp(ForecastList,CustId=Gallery1.Selected.'Acc No'),
		dateadded:Now(),
		Forecast:TextInput1.Text}
	)
)

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

3 REPLIES 3
BCBuizer
Super User
Super User

Hi @SimoneOS ,

 

You should be able to patch the inputs directly into the data source, but it seems you are getting an error.

 

To resolve, can you please share the Patch code and the error received?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Hi BCBuizer

The Patch code is:

Patch(ForecastList, Defaults(ForecastList),{Approved:false,CustId:LookUp(ForecastList,CustId=Gallery1.Selected.'Acc No'),dateadded:Now(),Forecast:Gallery5.AllItems})

The error message is: The type of this argument 'Title' does not match the expected Type "Text", Found type Table

BCBuizer
Super User
Super User

Hi @SimoneOS ,

 

In case you always want to create new items for all items in Gallery5, you can use a ForAll function to create them:

ForAll(
	Gallery5.AllItems,
	Patch(
		ForecastList,
		Defaults(ForecastList),
		{Approved:false,
		CustId:LookUp(ForecastList,CustId=Gallery1.Selected.'Acc No'),
		dateadded:Now(),
		Forecast:TextInput1.Text}
	)
)

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

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 (2,313)