cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

Hi guys, need some help with writing if statement and Patch function for my Submit button.

On select, i want to send the edit form field values to three different share point lists based on selected value from a drop down.

 

Below is the formulae i am trying but showing error message.

 

If(DataCardValue4.SelectedItems.Value="WH",Patch('WH Test list',Defaults('WH Test list'),{Title:DataCardValue3.Text,Partner:DataCardValue4.SelectedItems.Value},If(DataCardValue4.SelectedItems.Value="One",Patch('OS Test list',Defaults('OS Test list'),{Title:DataCardValue3.Text,Partner:DataCardValue4.SelectedItems.Value});SubmitForm(EditForm1)

 

Regards.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

Hi Rahber, yes the formulae worked with no error message.

 

But, it didn't work when i used on onSuccess attribute, so it used the formulae in submit button something like below it worked perfectly as i expected. Thank you very much for the help.

 

If(DataCardValue4.Selected.Value="WH",Patch('WH Test list',Defaults('WH Test list'),{Title:DataCardValue3.Text,What:DataCardValue6.Text,Who:DataCardValue7.Selected,Partner:DataCardValue4.Selected.Value}),If(DataCardValue4.Selected.Value="One",Patch('OS Test list',Defaults('OS Test list'),{Title:DataCardValue3.Text,What:DataCardValue6.Text,Who:DataCardValue7.Selected,Partner:DataCardValue4.Selected.Value})));SubmitForm(EditForm1);ResetForm(EditForm1)

 

Regards,

Raj.

View solution in original post

6 REPLIES 6
Highlighted
Super User
Super User

Re: Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

Patch and SubmitForm will both insert the data in your data source.

Are you trying to use both of them together?
Highlighted
Helper I
Helper I

Re: Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

Hi Rahber, thanks for the question.

 

I am trying to submit the edit form values to two different share point lists.

I am using patch function to send the values either to WH TEST LIST or OS TEST LIST based on selected value in my drop down

and at same time the values need to go into my master list.

 

Regards.

Raj.

Highlighted
Super User
Super User

Re: Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

This is how i will do it I will used On Submit the SubmitForm(EditForm1) formula.

On the onSuccess of MyForm i will use this code ( i fixed the error)

If(DataCardValue4.SelectedItems.Value="WH",Patch('WH Test list',Defaults('WH Test list'),{Title:DataCardValue5.Text,Partner:DataCardValue4.SelectedItems.Value}),If(DataCardValue4.SelectedItems.Value="One",Patch('OS Test list',Defaults('OS Test list'),{Title:DataCardValue5.Text,Partner:DataCardValue4.SelectedItems.Value})))

 

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

Highlighted
Helper I
Helper I

Re: Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

Hi Rahber, thanks for looking into this again.

 

I tried formulae on the onsuccess for my form, but still the error message is invalid argument type.

 

I couldn't see what i am missing.

 

Regards,

Raj. 

Highlighted
Super User
Super User

Re: Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

My apologies i overlooked the combo box.

Try this

If(DataCardValue4.Selected.Value="WH",Patch('WH Test list',Defaults('WH Test list'),{Title:DataCardValue5.Text,Partner:DataCardValue4.SelectedItems.Value}),If(DataCardValue4.Selected.Value="One",Patch('OS Test list',Defaults('OS Test list'),{Title:DataCardValue5.Text,Partner:DataCardValue4.SelectedItems.Value})))
Highlighted
Helper I
Helper I

Re: Power app to send edit form field values to multiple share point lists based on one of the drop down selected value

Hi Rahber, yes the formulae worked with no error message.

 

But, it didn't work when i used on onSuccess attribute, so it used the formulae in submit button something like below it worked perfectly as i expected. Thank you very much for the help.

 

If(DataCardValue4.Selected.Value="WH",Patch('WH Test list',Defaults('WH Test list'),{Title:DataCardValue3.Text,What:DataCardValue6.Text,Who:DataCardValue7.Selected,Partner:DataCardValue4.Selected.Value}),If(DataCardValue4.Selected.Value="One",Patch('OS Test list',Defaults('OS Test list'),{Title:DataCardValue3.Text,What:DataCardValue6.Text,Who:DataCardValue7.Selected,Partner:DataCardValue4.Selected.Value})));SubmitForm(EditForm1);ResetForm(EditForm1)

 

Regards,

Raj.

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,613)