cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hernandezdl
Regular Visitor

SharePoint PowerApps Form not updating with Revised Data

Background:

I have a List with three Choice fields that allow multiple values and I am trying to use a PowerApps Form for the user to update the information with.  The three fields are called Risk, CSResponsible and TRResponsible

 

Setup:

I have three Combo Boxes, one for each of my fields all of them allowing multiple selection, as follows:

Screen Shot 2019-07-09 at 3.21.03 PM.pngScreen Shot 2019-07-09 at 3.21.26 PM.png

And I have the following code:

SharePointForm1 OnSuccess:

Patch(tblDetailedRenewal,First(tblDetailedRenewal),{Title: SharePointForm1.LastSubmit.Title, Risk: cbRisk, 'CS Responsible':cbCSResponsible, 'TR Responsible': cbTRResponsible});

ResetForm(SharePointForm1); RequestHide()

 

For the Risk Data Card Update Property

ForAll(
cbRisk.SelectedItems,
{
Value: RiskName
}
)

For the CSResponsible Data Card Update Property

ForAll(
cbCSResponsible.SelectedItems,
{
Value: RiskName
}
)

For the TRResponsible Data Card Update Property

ForAll(
cbTRResponsible.SelectedItems,
{
Value: RiskName
}
)

 

DefaultSelectedItems is set to Parent.Default for all three

Default is blank for all three

 

The issue:

When I try to utilize the form in SharePoint, the form does not populate the latest set of recorded data (it displays the prior version) and when I try to save new information, the information does not always get recorded, or it records the Risk but not the CSResponsible or the TRResponsible fields -updating and displaying simply act erratically and not consistently.  Also, if I add a selection on the combo box, the Form simply records the last item selected, not all of the items selected

 

Can you please tell me what am I doing wrong? 

 

Thank you

2 REPLIES 2
v-yuxima-msft
Community Support
Community Support

Hi @hernandezdl 

 

Could you please more details of your data source?

Do you want to use Patch to save to choice field?

Is your Form one Customize form?

Could you please change your Patch formula expression as this case and then move the formula expression to SharePointIntegration.OnSave to test?

https://powerusers.microsoft.com/t5/General-Discussion/Patch-Combobox-to-SharePoint-Choice-Coloum/m-...

 

Best Regards.

Yumia

 

Hi  ,

 

Thanks for providing your response.  I have been trying for a couple of days to use your solution but I have been unabl eto make it work.

 

My data source is a SharePoint list

I am using Patch to save a choice filed

My form is a customized form, accessed directly from the Edit feature on the SharePoint list

 

I changed the formula as you suggested but the Value argument on the following parameter of the Patch formula yields an error:

 

Risk : ForAll(cbRisk.SelectedItems,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:Value})

 

Please note the options for the cbRisk combo box come from another List in SharePoint called tblRisk and the linked field is called RiskName.  So, if I change the above formula to:

 

Risk : ForAll(cbRisk.SelectedItems,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:Value(RiskName)})

 

I no longer get the error (the red underlining), but I also don't get the expected behavior (i.e. the record changes are not saved)

 

Can you please help with this additional information?

 

Thank you,

 

Eduardo

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,968)