cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThomFromUoC
Frequent Visitor

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
Community Support

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
Community Support

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
Frequent Visitor

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
Community Support

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
Frequent Visitor

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,793)