cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
water-guy-5
Helper I
Helper I

View and edit an existing sharepoint column in power apps canvas

Good afternoon, I have a two-page form that has many columns. For now, I have a navigation screen with a gallery that is supposed to let users view certain entries. First, I would like for the arrow in my gallery to be able to navigate them to the start of the form with the data from that column.

Gallery1.png


What code would I use on the arrow for it to navigate to the other screen WITH the entries related to that heading?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@water-guy-5 

Yes indeed.  We use forms all the time, but rarely use their interface because it is not flexible and a bit cumbersome to work with.

Take a look at my video on Forms Plus - everything you ever wanted to know about forms.  In particular, just to this part of the video on "Super Forms" where I discuss using a completely separate entry for a form.

 

It will amaze you what you can do with a form that you might not have ever thought off. 😉

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

13 REPLIES 13
RandyHayes
Super User
Super User

@water-guy-5 

Best to utilize a global variable for this!

In your arrow OnSelect action:

   Set(glbCurrentRecord, ThisItem); Navigate(otherScreenName)

 

Then make sure your Item property of your form is set to : glbCurrentRecord

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
BCLS776
Super User
Super User

A typical way to handle this is to put this code in the OnSelect of the arrow:

Select(Parent);
Navigate(Screen2);

And then on Screen2 have an EditForm control, with the same data source as the gallery and the following in its Item property:

myGalleryName.Selected

You will need to edit the gallery and screen names to fit with those used in your app.

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
RandyHayes
Super User
Super User

@BCLS776 

The problem with relying on the Selected property of the gallery is dependent on the Items property of the Gallery.  If there is any complexity to the Items property, then PowerApps will reevaluate the formula and will repopulate the Gallery and ultimately change the Selected item to be the first record.

Although I stay away from variables as much as possible in PowerApps, they do have a purpose, and in this case, it is to take a static snapshot of the record selected "at that time".  So, if the gallery repopulates and the first record becomes selected, any other reliance on the gallery selected item will now be inaccurate and can cause data issues.  Relying on the snapshot at that time will ensure that you are dealing with the record recorded at that time.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!


@RandyHayes wrote:

@BCLS776 

The problem with relying on the Selected property of the gallery is dependent on the Items property of the Gallery.  If there is any complexity to the Items property, then PowerApps will reevaluate the formula and will repopulate the Gallery and ultimately change the Selected item to be the first record.

Although I stay away from variables as much as possible in PowerApps, they do have a purpose, and in this case, it is to take a static snapshot of the record selected "at that time".  So, if the gallery repopulates and the first record becomes selected, any other reliance on the gallery selected item will now be inaccurate and can cause data issues.  Relying on the snapshot at that time will ensure that you are dealing with the record recorded at that time.

 


Good points, thank you Randy!

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
RandyHayes
Super User
Super User

@water-guy-5 

Only reason I mention it is because relying on Select (which I do often) has to be a design choice based on the Items property of the Gallery.  If it is a simple formula - Safe to use Select.  If it is complex - Use variable.

 

Case of a bad scenario -  using the Select and doing something in the OnSuccess.

OnSuccess formula:

    UpdateIf(dataSource, ID=Gallery1.Selected.ID, {Status: "complete"})

If the Gallery has a complex formula, the Gallery will repopulate after the Submit of the form.  This can cause the Selected item to go to record 1.  So, in the OnSuccess, the designer thinks they are updating the record selected originally that took them to a form and submitted, but in reality, it ends up updating the first record in the gallery instead.

 

Of course...one wouldn't write that formula like that anyway.  It would be : UpdateIf(dataSource, ID=Self.LastSubmit.ID, {Status: "complete"})  But, it was just an example of a "gotcha".

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I am trying my best to follow along. Thank you for the quick responses. I am not using an auto-generated form, instead I am using an empty canvas and have been inputting individual data cards and text labels. To get this data, I am using a Patch function instead of SubmitForm function.

Will the format that I'm using limit my ability to perform this operation?

RandyHayes
Super User
Super User

@water-guy-5 

It will not limit it, it will just overcomplicate it.  You had mentioned "form" so I assumed.  But, I would recommend a form for this rather than doing it by hand like that as you lose a lot of functionality that the form brings to you automatically.  You don't even have to use the form interface and can still use the form features.

 

Your existing by-hand approach is just going to need to rely on the global variable record to get its information.

What are some of your formulas for the Default properties of the controls you have now?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Do you mind expanding on how to use the "Edit Form" insert without having to actually use the interface? That is what I initially wanted to do, however the locked data cards and inability to change their size/position caused me to start with an empty canvas app instead.

Thanks for your patience.

RandyHayes
Super User
Super User

@water-guy-5 

Yes indeed.  We use forms all the time, but rarely use their interface because it is not flexible and a bit cumbersome to work with.

Take a look at my video on Forms Plus - everything you ever wanted to know about forms.  In particular, just to this part of the video on "Super Forms" where I discuss using a completely separate entry for a form.

 

It will amaze you what you can do with a form that you might not have ever thought off. 😉

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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