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

Re: Create a Button to Add User Information

So all of this works really well and I don't want to be a stickler, but here I go.  I still find myself having to use the refresh button before anything will change immidiately.  I don't know if there really is a way around it or not, however the button works both ways and so does the "Available?" field. 

Super User
Super User

Re: Create a Button to Add User Information

Well it sounds like some progress at least. Now let's nail down the last part.
What are you seeing that's not updating, your browse gallery, or the data?
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Salamander94
Level: Powered On

Re: Create a Button to Add User Information

A lot of progress so thank you for your help. 

So from the detail screen I hit the edit button.

Capture.PNG

and this is where I end up.  Now I'll hit the button and show you what happens after.

2.PNG

So, I added the refresh button to the detail screen.  After I hit refresh on this scree, this is what  I get.

3.PNG

Which is exactly what I want, but obviously I'd love for it to update on its own without hitting the refresh button.  I'm worried it might confuse our users.

Super User
Super User

Re: Create a Button to Add User Information

@Salamander94 

So one of the things that I was kind of leaning toward before was...why even have an EditForm?  There is nothing there to edit for the person checking out or in the book.

I was thinking more in terms of just having a screen with the Title and Author on it and a "Check out" or "Return" button (depending on the status).  Which actually leads us back to either a Patch statement (because we have no need for a Form) or having the EditForm fields be read-only.

 

Also, was considering, would you be wanting some logic for the Return/Check-in?  Seems you would want to check that the current user is the one that checked it out and only allow them to check it back in.  For all others there would not be any option to do anything.

 

Just kind of thinking through your scenario, but not sure that it actually would be what you want.

 

As for the refresh button...no...you don't want that, nor would you need it - people will be confused.  This is all quite possible to do without it.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Salamander94
Level: Powered On

Re: Create a Button to Add User Information

Yes, I agree there's no real point to an edit form screen while having those buttons.  The only thing I wonder is will the patch formula update the screen quick enough?  And yes some logic to check the user would be wonderful. 



 

Super User
Super User

Re: Create a Button to Add User Information

@Salamander94 

Yes, if you are patching/updating a datasource, this is immediate as, behind the scenes, it is updating the local "collection" which is the datasource and then making the round-trip to the actual data source for the real update.  The only "delay" would be experienced between multiple users on multiple devices.  A single user on a single device should always see immediate change.

So based on some of this, I'd say that something like this would be better for your situation:

Your Screen:

   Label 1 - Let's call it lblTitle

             Text property set to : BrowseGallery1.Selected.Title

   Label 2 - Let's call it lblAuthor

             Text property set to : BrowseGallery1.Selected.Author (assuming that's the column name for this)

   Label 3 - Let's call it lblCheckedOutTo

             Text property set to : BrowseGallery1.Selected.'Checked Out By'

             Visible property set to : !(IsBlank(BrowseGallery1.Selected.'Checked Out By'))

   Button 1 - Let's call it btnCheckInOut

             Text property set to : If(IsBlank(BrowseGallery1.Selected.'Checkd Out By'), "Check Out", "Return")

             Visible property set to : 

IsBlank(BrowseGallery1.Selected.'Checked Out By') || 
(!IsBlank(BrowseGallery1.Selected.'Checked Out By') &&
BrowseGallery1.Selected.'Checked Out By' = User().FullName)

              OnSelect action set to :  

Patch(IPC_LIB, 
BrowseGallery1.Selected,
{
'Checked Out By': If(IsBlank(BrowseGallery1.Selected.'Checked Out By'), User().FullName, "")
}
);
Back() // If you want to then return to the calling screen

This will give you three static labels with the Title and Author and the person it is checked out to.  The Check out to label will only be visible if it is actually checked out.

The button will only be visible if the book is not checked out to anyone (and will say "Check out") OR if the book is checked out to the current user (and it will say "Return").

When the button is clicked, it will patch the record from the BrowseGallery1.  If the book is checked out, it will "blank" the column, if it is not checked out, it will fill in the current user. Remember, this button is only visible given the above conditions, so we don't have to do any further checking in this formula.

 

See if that concept and scenario works for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Salamander94
Level: Powered On

Re: Create a Button to Add User Information

I apologize for this ignorant question, but should I be using these formulas on my browse screen or details screen?  I tried setting them for my browse screen, but then no data appeared.  I'll promptly try this on my details screen.

Salamander94
Level: Powered On

Re: Create a Button to Add User Information

Or should this be a new screen all together?


Super User
Super User

Re: Create a Button to Add User Information

@Salamander94 

I would just create a new screen for it.  There is no need for any other controls on it (except maybe some navigation header controls)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Salamander94
Level: Powered On

Re: Create a Button to Add User Information

Okay so it all works as you stated, but I still find myself having to refresh the browse screen in order to see the changes.


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: 327 members 6,061 guests
Please welcome our newest community members: