cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Accessing a field from record returned by the LookUp function

I have created an app for booking a set of iPads for preset time slots in a school situation. The point is to make the booking process as simple as possible.  The resource can be booked/cancelled just by selecting the desired class period and confirming - two button clicks, no filling out of forms.  All necessary info is added automatically.  The app is now fully functional, thanks in part to help from this forum, and I am working on cosmetic and UX tweaks.  One is causing me headaches.

 

The home screen, shown in the image below, has a button for each class period.  The button shows whether the resource is available or already booked for each period, by colour and by displaying the word "booked" or "available" as the case may be.  What I would like to do is replace the word "booked" with the name of the person who made the booking.

 

The app connects to a SharePoint calendar list.  The person who booked the resource is stored in a "person or group" type field called "Created_By".  The "booked/available" text on the button is just a label.  The code that determines the text of the label is:

 

If(LookUp('iPad Booking Calendar', DateValue(Text(Start_Time)) = _dateSelected && ThisRecord.Title="Booked Period 1", true), "booked", "available")

 

The formula works as is.  My understanding is that the LookUp function as used here returns the entire record found, so I should be able to access the "Created_by" field of that record.  It would seem logical to me that I could replace "booked" in the formula with some version of  ThisRecord.Created_By.DisplayName, but that doesn't work.

 

I think that I must be missing some key step between looking up the record and being able to access it later, or I am trying to do something in a way that isn't possible.

 

Any insight into this problem would be very much appreciated.  Thanks.

Chris

booked-available-screen.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Impactful Individual
Impactful Individual

Re: Accessing a field from record returned by the LookUp function

If(LookUp('iPad Booking Calendar', DateValue(Text(Start_Time)) = _dateSelected && ThisRecord.Title="Booked Period 1", true),
   LookUp('iPad Booking Calendar', DateValue(Text(Start_Time)) = _dateSelected && ThisRecord.Title="Booked Period 1").'Created By'.DisplayName, 

"available")

View solution in original post

3 REPLIES 3
Highlighted
Impactful Individual
Impactful Individual

Re: Accessing a field from record returned by the LookUp function

If(LookUp('iPad Booking Calendar', DateValue(Text(Start_Time)) = _dateSelected && ThisRecord.Title="Booked Period 1", true),
   LookUp('iPad Booking Calendar', DateValue(Text(Start_Time)) = _dateSelected && ThisRecord.Title="Booked Period 1").'Created By'.DisplayName, 

"available")

View solution in original post

Highlighted
Regular Visitor

Re: Accessing a field from record returned by the LookUp function

That works!  What's more, I now understand what you did there.  Thank you once again for your help.

Highlighted
Impactful Individual
Impactful Individual

Re: Accessing a field from record returned by the LookUp function

epic

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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