Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Patching saved value to Dataverse table

I'm am trying to implement an offline feature to my existing app.


I store recorded information in a collection and save it locally:


Collect(OfflineCustomerInterest, {OTitle: Title_dpd.SelectedText.Value, Ofirstname: FirstName_txt.Text, Olastname: FamilyName_txt.Text, OGender: Gender_dpd.SelectedText.Value, Oemailaddress1: Email_Text.Text, 'OPreferred Language (po_preferredlanguageid)': Language_dpd.Selected.Value, OCountry: Country_dpd.SelectedText.Value});
SaveData(OfflineCustomerInterest, "LocalSavedInterest");



I load this data back when the iPad has regained connection and loop through the collection using ForAll.


LoadData(OfflineCustomerInterest, "LocalSavedInterest" );


Update(FinalOfflineValuesDrops, First(FinalOfflineValuesDrops), {
OfflineTitleValue: OTitle,
OfflineGender: OGender,
OfflineLanguage: Text('OPreferred Language (po_preferredlanguageid)'),
OfflineCountry: OCountry});

If(Connection.Connected, Patch(Leads, Defaults(Leads), {Title: 'Lead Title_dpd_2'.Selected.Value, 'First Name': Ofirstname, 'Surname/Family Name': Olastname, Gender: 'Lead Gender_dpd_2'.Selected.Value, Email: Oemailaddress1, Country: ComboBox3_7.Selected, 'Preferred Language (po_preferredlanguageid)': ComboBox1_2.Selected})



The issue I am experiencing is with the "Gender", "Preferred Language (po_preferredlanguage)", and "Country" fields in the patch command as these originate from drop down fields and are not derived from text fields. They are also all complex data types in the Dataverse table.


The drop down fields retrieve there items from the Dataverse storage like so: 


If(Connection.Connected, Choices([@Leads].Gender))


and default value like so:





The problem that I'm experiencing is that when the items are uploaded it seems to only select the initial default value.

For example, if I had three offline values for "Sam", Paul" and "Lucy", there gender value for each person would be "Male" where "OfflineGender" would have cycled through "Male", "Prefer not to say", "Female".


Is there some way I can force refresh this for it to work?


Hopefully I've explained this well, if not please ask questions.

Thanks in advance for helping find a solution! 🙂


Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,800)