cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RV_KONDRA
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

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
Rahber
Super User
Super User

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

Are you trying to use both of them together?

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.

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

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. 

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})))

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,329)