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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Apps Form, Text ...
Power Apps
Unanswered

Power Apps Form, Text Data Card

(0) ShareShare
ReportReport
Posted on by 8

I have a text data card in a form with the following formula to auto populate other data cards, but it stopped working last week:

If(

        !IsBlank(LookUp(EISReference, EmpNumText = txtEmpNo.Text)),

        Set(varUser, LookUp(EISReference, EmpNumText = txtEmpNo.Text)),

        If(

            !IsBlank(LookUp(EISRetired, EmpNumText = txtEmpNo.Text)),

            Set(varUser, LookUp(EISRetired, EmpNumText = txtEmpNo.Text)),

            Set(varUser, Blank())

        )

    )

The formula is in the On Change property of the data card, and it worked before without any issues.  My data source and connections are working, because I can add a text input control and a button, with the same formula and I am able to auto populate the other data card fields.  

 

I am also seeing some glitching, where the formula will work in edit mode, but when I publish and run the app, it doesn't work.

 

Any ideas?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @cglowtechuser ,

    A few things here - you can condense that code into

    Set(
     varUser,
     Coalesce(
     LookUp(
     EISReference, 
     EmpNumText = txtEmpNo.Text
     ),
     LookUp(
     EISRetired, 
     EmpNumText = txtEmpNo.Text
     )
     )
    )

    however you are setting the variable in both instances to a Record. To do this, both data sources would need to be completely identical in both field names and types. If you simply want a field out of the lists, it would not have this restriction.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • cglowtechuser Profile Picture
    8 on at

    Thank you @WarrenBelz . The two data sources I am using are identical, and I am only pulling specific fields from the lists that are named exactly the same. I tried your code, but I am still having the same issue where I can't get the other fields to auto-populate. 

  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @cglowtechuser ,

    What is your data source ?

  • cglowtechuser Profile Picture
    8 on at

    They are Sharepoint Lists.

  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @cglowtechuser ,

    A bit of debugging required here - firstly assuming this code is on the OnChange of EmpNoText, set the DelayOutput to true and do this (although I do not think anything here is your issue)

    Set(
     varUser,
     Coalesce(
     LookUp(
     EISReference, 
     EmpNumText = Self.Text
     ),
     LookUp(
     EISRetired, 
     EmpNumText = Self.Text
     )
     )
    )

    Next, pick (any) field name in EISReference / EISRetired that would indicate the correct record has been chosen and put this on a Label

    varUser.YourFieldName

    I am first trying to establish that the Variable has been updated (or not) to isolate the cause of the issue.

     

  • cglowtechuser Profile Picture
    8 on at

    @WarrenBelz 

    I was able to get the app to work with your code in preview mode.  I saved and published it, ran it again in preview mode and it worked.  I then opened the published app, and it does not work. 😵  This has happened a few times already, where I am able to get the app to work in edit mode, but when I go to the live app it doesn't.

     

    I'm close to acting out scenes from Office Space with my work station. 😫

  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @cglowtechuser ,

    My fear here is exactly what I eluded to at the start - controls simply do not like multiple data sources possibilities in their outputs. You will not get any error, however they will often not work (or more annoyingly) not consistently work. I simply do not try it any more. One logic may be that you could add, delete or change the name of a field in one of the lists and not the other and instantly make the thing invalid.
    This is why I said setting the Variable to a single value will not cause the issue.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • cglowtechuser Profile Picture
    8 on at

    Hi @WarrenBelz 

    So I removed the 2nd data source in the look up formula and made it a simple look up formula to see if that was the issue.

    LookUp(EISReference, EmpNumText = txtEmpNo.Text, DisplayName)

    It does not work in the form, but if I add a text input and label outside of the form, my formula does pull the information.  

  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @cglowtechuser ,

    Is DisplayName a field name or are you looking up a Person field ? It also does not make a lot of sense to get different results inside / outside a form as a control content can be referenced the same in both cases.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard