cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pnass001
Post Patron
Post Patron

Drop Down Selection not aligning with selected submission

When I click on the "SubmitForm" button, I would like my 3 drop downs to stay at their most recent submitted text (unless new form is selected which I want all fields to blank out -reset) and currently they don't blank out. My first Item is "" and I would like my drop downs to reset to the first Item. Currently all dropdown fields are staying at the most recent submission while all other fields most along with the submission I select from Gallery. I would like all dropdown selections to change as I change to edit the submission within Gallery.  What can I do to fix this?

 

Default for drop down: VarLastItems.ColumnName

 

Form Onsuccess: Refresh('Standards Selection Form Data Collection') And Set(VarLastItems,Form2.LastSubmit) 

 

1 ACCEPTED SOLUTION

Accepted Solutions

HI @pnass001 ,

Have you taken a try with my first reply solution?

 

Based on the needs that you mentioned, I think the solution in my first reply could achieve your needs. Please take a try with it, check if it could achieve your needs.

 

Of course, if you want to get the latest record you submitted in the SP List, please try to set the OnSuccess property of the Edit form to following:

Set(VarLastItems, Form2.LastSubmit);    // save the submitted record into a variable
Refresh('Standards Selection Form Data Collection')

or

Refresh('Standards Selection Form Data Collection');
Set(VarLastItems, Last(Filter('Standards Selection Form Data Collection', 'Created By'.Email = User().Email)));    // retrieve your latest submitted record from the SP List, thne save it into a variable

 

Set the OnSelect property of the "Edit" icon to following (press it to edit a selected Gallery Item) :

EditForm(Form2);
Set(VarLastItems, Blank()); // Clear the VarLastItems variable
Navigate(EditFormScreen2);

 

Set the Item property of the Edit form (Form2) to following:

If(
   IsBlank(VarLastItems),
   BrowseGallery1.Selected,
   VarLastItems
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-xida-msft
Community Support
Community Support

Hi @pnass001 ,

Could you please share a bit more about your scenario?

Do you want these three Dropdown box to display the stored values when you are going to edit the item from your Gallery?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Edit" icon to following (press it to edit a selected Gallery Item) :

EditForm(Form2);
Set(VarLastItems, Blank()); // Clear the VarLastItems variable
Navigate(EditFormScreen2);

 

Set the Default property of the Dropdown box to following:

If(
   Form2.Mode = FormMode.New,
   "",
   Form2.Mode = FormMode.Edit,
   If(
      !IsBlank(VarLastItems),
      VarLastItems.ColumnName,    // Replace the ColumnName with actual column name from your data source
      Parent.Default             // or type ThisItem.ColumnName here
   )
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft  Yes I would like the drop downs to display stored values. This worked in allowing the drop down values to change alongside their form submission Thank you.

 

One more thing, when the user returns to

(EditFormScreen2)

I would like the very last submission to be populated within the fields to be edited. Currently the fields are populated with a previous submission and not the most recent. How can I keep the last submitted fields within the drop down the same?  

 

Also when I hit "new form" I would like the drop downs to go to the first Item within their Items list. which is ""

Do you want to populate the Dropdown box with the Latest submission in your SP List (maybe the latest submission not submitted by yourself)?

 

Based on the needs that you mentioned, try the following workaround:

Set the OnSelect property of the "Edit" icon to following (press it to edit a selected Gallery Item) :

EditForm(Form2);
Set(CurrentEditItem, BrowseGallery1.Selected); // Modify formula here
Navigate(EditFormScreen2);

please modify the formula within the Default property of the Dropdown box to following:

If(
   Form2.Mode = FormMode.New,
   "",
   Form2.Mode = FormMode.Edit,
   If(
      IsBlank(CurrentEditItem),
      Last('Your SP List').ColumnName,    // Replace the ColumnName with actual column name from your data source
      Parent.Default             // or type ThisItem.ColumnName here
   )
)

Set the OnSuccess property of the Form2 to following:

Refresh('Standards Selection Form Data Collection');
Set(CurrentEditItem, Blank())   // Modify formula here

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft  That works to reset the drop downs to blanks! thank you.

 

I would like the very last submission which I just submitted to populate all fields. Currently when I submit the fields change to a random previous submission

HI @pnass001 ,

Have you taken a try with my first reply solution?

 

Based on the needs that you mentioned, I think the solution in my first reply could achieve your needs. Please take a try with it, check if it could achieve your needs.

 

Of course, if you want to get the latest record you submitted in the SP List, please try to set the OnSuccess property of the Edit form to following:

Set(VarLastItems, Form2.LastSubmit);    // save the submitted record into a variable
Refresh('Standards Selection Form Data Collection')

or

Refresh('Standards Selection Form Data Collection');
Set(VarLastItems, Last(Filter('Standards Selection Form Data Collection', 'Created By'.Email = User().Email)));    // retrieve your latest submitted record from the SP List, thne save it into a variable

 

Set the OnSelect property of the "Edit" icon to following (press it to edit a selected Gallery Item) :

EditForm(Form2);
Set(VarLastItems, Blank()); // Clear the VarLastItems variable
Navigate(EditFormScreen2);

 

Set the Item property of the Edit form (Form2) to following:

If(
   IsBlank(VarLastItems),
   BrowseGallery1.Selected,
   VarLastItems
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft Adding Item property of the Edit form (Form2) helped. Thank you or your patience. It works not perfectly how I want it!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,141)