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

Gallery to Form copy - restricted to one attempt?

Hi there

 

I have a PowerApp canvas development that has a gallery linked to a SharePoint list. When a checkbox is ticked this applies the relevant filter to bring through the required record. I then have a Form (in New mode) pointing to the same SharePoint list, that has it's datacardvalue default attributes referencing the gallery fields.

 

This works, and allows a user to pull through the details of a previous 'booking' so they only have to update one or two of the remaining required fields.

 

Unticking the checkbox then blanks the gallery and the form, as you'd expect. However, re-ticking the checkbox only repopulates the gallery - the form remains blank. It is as if there is a hidden setting within the form that only allows it to be copy into once. If you so close the app completely and return to it, it then works but again, only the once.

 

I have tried: Resetting form, refreshing datasource, putting data in a collection and clearing. There maybe a specifc way to do this that I haven't looked at, but it feels like it shouldn't be this difficult for the form to pick up the data more than once.

 

This seems very odd and not particularly intuitive. Any help with this would be greatly appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Gallery to Form copy - restricted to one attempt?

Hi @ThomFromUoC ,

Based on the formula that you provided, I could not find any syntax error with it.

 

Please make sure that the DefaultMode property of the Edit form control in your app has been set to following:

FormMode.New           /* <-- set to NEW mode, rather than EDIT mode  */

Then within your Edit form, please take a try with the following formula to reference values:

Gallery1.Selected.ColumnName

 

Actually, it is not necessary to reference values from your Gallery, you could reference values from your data source directly. Please also consider take a try with the following workaround:

Set the Default property of the Text Input box within the Edit form to following:

If(
   CheckBox1.Value = true,
   First(SortByColumns(Filter('SPListData', Created_By_ID = Lbl_User_ID.Text),"Created", Descending)).ColumnName
)

Please 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.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Gallery to Form copy - restricted to one attempt?

Hi @ThomFromUoC ,

Could you please share a bit more about your scenario?

Could you please share a screenshot about your app's configuration? How do you bind your Gallery with your Edit form?

Currently, on my side, I could not reproduce your issue. As an alternative solution, I think a Global variable could achieve your needs.

On your side, you could consider save the related record within your Gallery into a variable, then within your Edit form, you could set the Default value of the Data cards in your Edit form via referencing values from the variable.

 

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

Set the OnVisible property of the Edit Screen/New Screen which contains the Edit form to following:

Set(CurrentRequiredRecord, Gallery1.Selected)   /* <-- Gallery1 represents the Gallery in your app */

Then when you want to set the Default value of the Data cards in your Edit form, please use the following formula:

CurrentRequiredRecord.ColumnName        /* <-- ColumnName represents the Column in your SP list */

Or

CurrentRequiredRecord.ColumnName.Value    /* <-- If the ColumnName is a Choice or LookUp type column */

 

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.
ThomFromUoC
Level: Powered On

Re: Gallery to Form copy - restricted to one attempt?

Hi Kris

 

Thanks for getting back to me.

 

I tried your suggestion but the same issue occurred (i.e. form only updates it's fields once based on the checkbox value). This issue, which seems to be how the form 'accepts' the data from the gallery, is even more confusing as it works on the first attempt everytime (closing the app and reopening seems to reset and allows you to do the single attempt again).

 

Have a look at the attached to help clarify what I have been trying. Be really interested to see what you think is occurring here. Cheers

Community Support Team
Community Support Team

Re: Gallery to Form copy - restricted to one attempt?

Hi @ThomFromUoC ,

Based on the formula that you provided, I could not find any syntax error with it.

 

Please make sure that the DefaultMode property of the Edit form control in your app has been set to following:

FormMode.New           /* <-- set to NEW mode, rather than EDIT mode  */

Then within your Edit form, please take a try with the following formula to reference values:

Gallery1.Selected.ColumnName

 

Actually, it is not necessary to reference values from your Gallery, you could reference values from your data source directly. Please also consider take a try with the following workaround:

Set the Default property of the Text Input box within the Edit form to following:

If(
   CheckBox1.Value = true,
   First(SortByColumns(Filter('SPListData', Created_By_ID = Lbl_User_ID.Text),"Created", Descending)).ColumnName
)

Please 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.

View solution in original post

ThomFromUoC
Level: Powered On

Re: Gallery to Form copy - restricted to one attempt?

Hi Kris

 

Been on leave so only just tried your suggestion - and it works!!! Many thanks again.

 

Set the Default property of the Text Input box within the Edit form to following:

If(
   CheckBox1.Value = true,
   First(SortByColumns(Filter('SPListData', Created_By_ID = Lbl_User_ID.Text),"Created", Descending)).ColumnName
)

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 429 members 5,847 guests
Recent signins:
Please welcome our newest community members: