Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

Gallery control items randomly changing after sending data to dataverse table in canvas app

(0) ShareShare
ReportReport
Posted on by 8

Dear All,

 

I am new to Power Apps, I am working on a project but I am facing an issue which I cannot solve. Could anybody help me or give any advice? In advance, I am sorry for the long description it is because I copied all the relevant attributes below. 

 

I am creating a canvas app which has a screen of gallery control items (see below).

freidav1984_0-1628951333874.png

I have dropdown fields, a date picker field and a comment field.

I have also two toggle controls (Zusatzreinigung and wasche service), if these are set to true value, the hours text boxes will be editable, and prices will also be calculated. 

If the user changes the values of the above shown fields, the values will be added to a collection (JobUpdates). After clicking on the "Save" button, the values from the collection are sent to a dataverse table. 

 

BUT:

After saving the data and adding new rows to the gallery the priorly recorded values are randomly changing (toggle controlls, the text fields of hours and the content of the comment field)

 

See below, I added the 00149 record to the gallery. After I hit "Save" the Wasche Service toggle changed to "No" / false, the hours also changed to zero. After Saving, I checked my dataverse table, and the values which are changing are not written into the table. I do not understand this, because as I see, the collection contains all of the changing data values.

 

freidav1984_1-1628952231768.pngfreidav1984_2-1628952307808.png

 

Does anyone have an idea what could be the problem? Any help would greatly be appreciated.

 

The App's OnStart attribute:

ClearCollect(
JobUpdates;
ShowColumns(
Table(Defaults(TESZT_Cleaning_Job));
"cr0f6_job_id";
"cr0f6_partner";
"cr0f6_location";
"cr0f6_room";
"cr0f6_price";
"cr0f6_datetimeofcleaningjob";
"cr0f6_completed";
"cr0f6_teszt_cleaning_jobid";
"cr0f6_commentoncleaningjob";
"cr0f6_zusatzreinigungstunden";
"cr0f6_zusatzreinigungprice";
"cr0f6_wascheservicestunden";
"cr0f6_wascheserviceprice";
"cr0f6_zusatzreinigung";
"cr0f6_wascheservice"
));;
Clear(JobUpdates)

 

Add row button OnSelect:

Clear(JobUpdates);;
Patch(TESZT_Cleaning_Job;Defaults(TESZT_Cleaning_Job);{Partner: ""; Location: ""; Room: ""; 'Date & Time of cleaning job': Today()})

 

The gallery items' OnChange property:

If(
ThisItem.cr0f6_teszt_cleaning_jobid in JobUpdates.cr0f6_teszt_cleaning_jobid;
Update(
JobUpdates;
LookUp(
JobUpdates;
cr0f6_teszt_cleaning_jobid = ThisItem.cr0f6_teszt_cleaning_jobid
);
{
cr0f6_teszt_cleaning_jobid: ThisItem.cr0f6_teszt_cleaning_jobid;
cr0f6_partner: Dropdown2.Selected.Result;
cr0f6_location: Dropdown2_1.Selected.Result;
cr0f6_room: Dropdown2_2.Selected.Room;
cr0f6_price: Value(TextInput1_1.Text);
cr0f6_datetimeofcleaningjob: DatePicker1.SelectedDate;
cr0f6_commentoncleaningjob: TextInput1_2.Text;
cr0f6_zusatzreinigung:If(Toggle1_1.Value; 'Zusatzreinigung (TESZT_Cleaning_Job)'.'1'; 'Zusatzreinigung (TESZT_Cleaning_Job)'.'0');
cr0f6_wascheservice:If(Toggle1_2.Value; 'Wasche Service (TESZT_Cleaning_Job)'.'1'; 'Wasche Service (TESZT_Cleaning_Job)'.'0');
cr0f6_zusatzreinigungstunden: Value(TextInput2.Text);
cr0f6_wascheservicestunden: Value(TextInput2_1.Text);
cr0f6_zusatzreinigungprice: Value(TextInput1_3.Text);
cr0f6_wascheserviceprice: Value(TextInput1_4.Text);
cr0f6_completed:If(Toggle1.Value; 'Completed (TESZT_Cleaning_Job)'.'1'; 'Completed (TESZT_Cleaning_Job)'.'0')
}
);
Collect(
JobUpdates;
{
cr0f6_teszt_cleaning_jobid: ThisItem.cr0f6_teszt_cleaning_jobid;
cr0f6_partner: Dropdown2.Selected.Result;
cr0f6_location: Dropdown2_1.Selected.Result;
cr0f6_room: Dropdown2_2.Selected.Room;
cr0f6_price: Value(TextInput1_1.Text);
cr0f6_datetimeofcleaningjob: DatePicker1.SelectedDate;
cr0f6_commentoncleaningjob: TextInput1_2.Text;
cr0f6_zusatzreinigung:If(Toggle1_1.Value; 'Zusatzreinigung (TESZT_Cleaning_Job)'.'1'; 'Zusatzreinigung (TESZT_Cleaning_Job)'.'0');
cr0f6_wascheservice:If(Toggle1_2.Value; 'Wasche Service (TESZT_Cleaning_Job)'.'1'; 'Wasche Service (TESZT_Cleaning_Job)'.'0');
cr0f6_zusatzreinigungstunden: Value(TextInput2.Text);
cr0f6_wascheservicestunden: Value(TextInput2_1.Text);
cr0f6_zusatzreinigungprice: Value(TextInput1_3.Text);
cr0f6_wascheserviceprice: Value(TextInput1_4.Text);
cr0f6_completed:If(Toggle1.Value; 'Completed (TESZT_Cleaning_Job)'.'1'; 'Completed (TESZT_Cleaning_Job)'.'0')
}
)
)

 

The Default property of the gallery items (in order to show the priorly added records after clicking on the new row button):

If(
IsBlank(ThisItem.Partner);
LookUp(TESZT_Cleaning_Job; cr0f6_teszt_cleaning_jobid = ThisItem.TESZT_Cleaning_Job; Partner);
ThisItem.Partner
)

 

The OnSelect property of the Save button:

If(
CountRows(JobUpdates) > 0; Patch(TESZT_Cleaning_Job; JobUpdates);Notify("Success";NotificationType.Success));;Clear(JobUpdates)

 

Thanks a lot!

 

David

  • freidav1984 Profile Picture
    8 on at
    Re: Gallery control items randomly changing after sending data to dataverse table in canvas app

    Do you mean in the connecting dataverse table?

    the wrong updated values are stored in there.

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at
    Re: Gallery control items randomly changing after sending data to dataverse table in canvas app

    Hi @freidav1984 ,

     

    All the selected values are getting stored in the list or the wrong updated values are getting stored in the list ?

  • freidav1984 Profile Picture
    8 on at
    Re: Gallery control items randomly changing after sending data to dataverse table in canvas app

    Hi PG_WorXz10!

     

    Of course:

    Default prop (every item has the same, using the proper database column-relation):

    LookUp(TESZT_Cleaning_Job; cr0f6_teszt_cleaning_jobid = ThisItem.TESZT_Cleaning_Job; 'Wasche Service')

     

    Reset is "false" at every gallery control item.

     

    Thx

    David

     

     

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at
    Re: Gallery control items randomly changing after sending data to dataverse table in canvas app

    Hi @freidav1984 ,

     

    Could you please check the reset and Default property of these controls ? If possible please share the codes  Default and reset of these controls 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
mmbr1606 Profile Picture

mmbr1606 15 Super User 2025 Season 1

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics