cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
roknron
Helper I
Helper I

Gallery field updates but record pointer of sharepoint list does not move to the newly added record.

I previously reached out for this issue and didn't receive a response.  I though I would try again and explain more clearly.

 

I have a sharepoint list with about 10 columns where I need to apply logic to 3 of the columns.  Column 1 "Start", Column 2 "End" and Column 3 "TT".  Example of the values  Start = 10, End = 11.2 and TT = 1.2.  Now if edit the current record and change the value of End, when the form is submitted the value TT is adjusted to TT = End - Start.  The propblem comes when I add more than one new record.  The newform has only the End column presented and I want to assign the value of the current record for End to Start, then the user supplies the value for End to the new record and the calculation is performed.  The submit button is selected and the app returns to the BrowseGallery screen.  The BrowseGallery screen refreshes the gallery and the newly added record is displayed.  When the add button is selected from the Gallery I set a context variable so the edit screen is set to NewForm mode.  The Start datacardvalue sets a value based on this screen mode. I.e., if (var = value ,x ,y). The datacard associated with the Start column of the sharepoint list is set to the BrowseGallery field value of End.  While debugging this I have the Start datacard visible and observe the value is set to the previous record value.  How do I caputer the value of the newly added record?

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi roknron,

 

What are the column types of the three columns in your list, Start, End, TT?


Is TT calculated on the app or in the list(a calculated column)?

 

I am not sure with the following sentence:
“The newform has only the End column presented and I want to assign the value of the current record for End to Start, then the user supplies the value for End to the new record and the calculation is performed”.
>What’s the code you are using at here? A screenshot would be better for understanding.

 

About this sentence:
When the add button is selected from the Gallery I set a context variable so the edit screen is set to NewForm mode.
>What’s the function you are using at here? Is it a NewForm function or UpdateContext function?

 

About this sentence:
The datacard associated with the Start column of the sharepoint list is set to the BrowseGallery field value of End.
>Why are you setting the field for Start column to the value of End? While I think it should be set to the value of Start itself.

 

When a new record is added, you will be able to check it on the gallery. Please take this documentation for a reference:
https://powerapps.microsoft.com/en-us/tutorials/working-with-forms/

 

I would like to know more details about your scenario, some screenshots and the codes you are using on your side would be better for understanding.


Best regards,
Mabel Mao

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


@v-yamao-msft wrote:

Hi roknron,

 

What are the column types of the three columns in your list, Start, End, TT?


Is TT calculated on the app or in the list(a calculated column)?

 

I am not sure with the following sentence:
“The newform has only the End column presented and I want to assign the value of the current record for End to Start, then the user supplies the value for End to the new record and the calculation is performed”.
>What’s the code you are using at here? A screenshot would be better for understanding.

 

About this sentence:
When the add button is selected from the Gallery I set a context variable so the edit screen is set to NewForm mode.
>What’s the function you are using at here? Is it a NewForm function or UpdateContext function?

 

About this sentence:
The datacard associated with the Start column of the sharepoint list is set to the BrowseGallery field value of End.
>Why are you setting the field for Start column to the value of End? While I think it should be set to the value of Start itself.

 

When a new record is added, you will be able to check it on the gallery. Please take this documentation for a reference:
https://powerapps.microsoft.com/en-us/tutorials/working-with-forms/

 

I would like to know more details about your scenario, some screenshots and the codes you are using on your side would be better for understanding.


Best regards,
Mabel Mao



Formula to set value of StartHobbs.  Depends on the form mode set.Formula to set value of StartHobbs. Depends on the form mode set.Formula to navigate to detail form from galleryFormula to navigate to detail form from galleryStartHobbs value when adding the second record.  This value should be the value of EndHobbs from the gallery fldEndHobbsStartHobbs value when adding the second record. This value should be the value of EndHobbs from the gallery fldEndHobbs

Formula to add record.  Sets context variable frmMode to 1Formula to add record. Sets context variable frmMode to 1Sets context variable frmMode to 2Sets context variable frmMode to 2

 

All of the columns type are number.  The calculation is done in the app and the columns are only containers for the data.  In the first paragraph about the End column.  Specifically EndHobbs is the only column of the three involved in my problem that requires user input.  The Start and TT should be controlled by the app.  Start and TT are hidden from the user.  StartHobbs is displayed in the images for debugging.

 

2.  The context variable is frmMode which is set to 1 when adding new records and when the navigate button is selected on the gallery this context variable is set to 2 when the edit button is selected from the detail screen. 

 

3.  When adding new records the value of Start becomes the most recent value of End and then the user provides the new record value of end and TT is calculated TT = End - Start.  Then the form is submitted.

 

Now come the problem when I try to add more than one new record the second and any subsequent record have the same value of the last Start value.  In the process of debugging I find that the value being assigned to sHobbs is 0 (third image above) and End - Start is the value of End which is assigned to Start in the form submit.  

 

The blue circle is the new value of fldEndHobbs and you can see from the formula, I am updating the context variable sHobbs with the text fo fldEndHobbsThe blue circle is the new value of fldEndHobbs and you can see from the formula, I am updating the context variable sHobbs with the text fo fldEndHobbs

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,791)