web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help getting the ...
Power Apps
Answered

Need help getting the results of a Lookup to display

(0) ShareShare
ReportReport
Posted on by 332

I have a form in my app (Form1) that switches between Edit mode and New mode depending on if the selected item is blank or not. There's a Rich Text Editor in the form, and I want its default to show previously entered data if the form is in Edit mode, or the results of a Lookup if the form is in New mode.

 

The code I'm using in the default property of the Rich Text Editor is:

 

If(
Form1.Mode=FormMode.New, LookUp(SharePointList, ID=ThisItem.ID).Title,
Parent.Default
)

 

Title is what I want to show up in my rich text editor control when the form is in New mode. The code isn't giving me any errors, but it doesn't show anything in the control when the form mode is New. It does show previously entered data when the form mode is Edit.

 

If I replace LookUp(SharePointList, ID=ThisItem.ID).Title with a hard-coded value, the formula works as intended. I just can't get it to display the results of the Lookup.

 

Any suggestions would be greatly appreciated. Thanks!

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @T_A_M

    Try Coalesce(Parent.Default, LookUp(SharePointList, ID=ThisItem.ID).Title)

    Since Parent.Default is blank in new forms. 

  • T_A_M Profile Picture
    332 on at

    Unfortunately, that behaved the same. I still get a result in the Rich Text editor control when the form is in Edit mode, and nothing when it is in New mode.

  • Verified answer
    T_A_M Profile Picture
    332 on at

    I came up with a solution. I set a variable Set(QuestionVar, Gallery1.Selected.Title) in the OnVisible property of the page, and on the OnSelect propert of Gallery1. (The data source for Gallery1 is SharePointList.) 

     

    Then I put this code in the Default property of my rich text editor control:

     

    If(
    Form1.Mode=FormMode.New, QuestionVar,
    Parent.Default
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard