cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mahakala_
Level: Powered On

How to display data from collection back on controls

I have textinput controls, dropdown controls and radial controls that collect data into a collection.  Then it goes to another screen with a gallery that shows the records of each collection.  Each record has a checkbox. If checked, I click on the modify button, which brings me back to the previous screens with those controls to edit the data.  What formula and which property should I do this in to accomplish this?  The easiest way i thought was to use an edit form on one page, and gallery on another page.  But i found that the edit form can't connect to a collection.  Another way was to use global variables, but I dont know which property to use it on.  Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to display data from collection back on controls

Hi @mahakala_ ,

Just make a little change.

1)the submit button's OnSelect:

If(var="new",Collect(test,{field1:TextInput1.Text,field2Smiley Very Happyropdown1.Selected.Value,field3:Radio1.Selected.Value}),
Patch(test,Gallery2.Selected,{field1:TextInput1.Text,field2Smiley Very Happyropdown1.Selected.Value,field3:Radio1.Selected.Value}));
Reset(TextInput8);Reset(Dropdown1);Reset(Radio1);Set(var,"new");Back()

2)The arrow button's OnSelect:

If(Checkbox1.Value,Navigate(Screen3);Reset(Checkbox1);Set(var,"edit"));
Reset(TextInput8);Reset(Dropdown1);Reset(Radio1)

3)The add button's OnSelect:

Navigate(Screen3);Reset(TextInput8);Reset(Dropdown1);Reset(Radio1);Set(var,"new")

 

Best regards,

Community Support Team _ Phoebe Liu
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
Community Support Team
Community Support Team

Re: How to display data from collection back on controls

Hi @mahakala_ ,

Yes, since edit form can not use collection, so the issue is a little complex.

However, it also could make.

I've made a similar test for your reference:

1)Screen1

insert a gallery, insert a checkbox inside the gallery, insert an add button.

Set the gallery's Item: test

Set the  arrow button's OnSelect:

If(Checkbox1.Value,Navigate(Screen2);Set(var,"edit"))

Set the add button's OnSelect:

Navigate(Screen2);Set(var,"new")

2)insert a textinput, a drop down, a radio button, a button.

Set the textinput's Default:

If(var="new","",Gallery1.Selected.field1)

Set the drop down's Default:

If(var="new","",Gallery1.Selected.field2)

Set the radio button's Default:

If(var="new","",Gallery1.Selected.field3)

Set the submit button's OnSelect:

If(var="new",Collect(test,{field1:TextInput2.Text,field2Smiley Very Happyropdown1.Selected.Value,field3:Radio1.Selected.Value}),
Patch(test,Gallery3.Selected,{field1:TextInput2.Text,field2Smiley Very Happyropdown1.Selected.Value,field3:Radio1.Selected.Value}))

9123.PNG

 

9124.PNG

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mahakala_
Level: Powered On

Re: How to display data from collection back on controls

Hi @v-yutliu-msft ,

 

That worked thank you very much for your help!

 

The only problem now is that for some reason, when I try to modify the very first record, it always populates the last record I entered into the collection.  For example if I entered 4 records into a collection on screen 1: records A, B, C, D.  It transitions to screen 2 which shows all 4 records in the gallery.  If I check record A, and hit modify button, it takes me back to screen 1, but it shows record D.  It only happens if I check record A first.  If I check record B, C, or D, it works fine.  It also works if I check record B first and then unchecking it (without hitting the modify button), then checking A again.  Then if I hit the modify button it will show me record A.  

I tried to set 'checkbox.reset' to true but that did not work.  

Community Support Team
Community Support Team

Re: How to display data from collection back on controls

Hi @mahakala_ ,

Just make a little change.

1)the submit button's OnSelect:

If(var="new",Collect(test,{field1:TextInput1.Text,field2Smiley Very Happyropdown1.Selected.Value,field3:Radio1.Selected.Value}),
Patch(test,Gallery2.Selected,{field1:TextInput1.Text,field2Smiley Very Happyropdown1.Selected.Value,field3:Radio1.Selected.Value}));
Reset(TextInput8);Reset(Dropdown1);Reset(Radio1);Set(var,"new");Back()

2)The arrow button's OnSelect:

If(Checkbox1.Value,Navigate(Screen3);Reset(Checkbox1);Set(var,"edit"));
Reset(TextInput8);Reset(Dropdown1);Reset(Radio1)

3)The add button's OnSelect:

Navigate(Screen3);Reset(TextInput8);Reset(Dropdown1);Reset(Radio1);Set(var,"new")

 

Best regards,

Community Support Team _ Phoebe Liu
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

mahakala_
Level: Powered On

Re: How to display data from collection back on controls

Hi @v-yutliu-msft ,

 

Yes that worked! I didnt use it exactly liked you have used it, for example I didnt use an arrow but I did use the resets on the controls and that worked.  Thank you so much for your help!

mahakala_
Level: Powered On

Re: How to display data from collection back on controls

mahakala_
Level: Powered On

Re: How to display data from collection back on controls

Hi @v-yutliu-msft ,

 

Please disregard the last msg to you.  The problem has been resolved over at https://powerusers.microsoft.com/t5/General-Discussion/Gallery-Selected-is-not-working-as-it-s-suppo...

 

Thank You.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 94 members 3,708 guests
Please welcome our newest community members: