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 / Lookup (Dataverse Tabl...
Power Apps
Answered

Lookup (Dataverse Tables) & Error Message "Invalid data from the network"

(1) ShareShare
ReportReport
Posted on by 214
Hi,
 
I am building an app in PowerApps and the data lives in Dataverse.
 
I have a label that keeps triggering the error message, "Invalid data from the network." The label's text property has the following code:
 
LookUp(BTS_Projects, cr622_projectnumber = Value(coverProjectNumberDATA.Text),'Consulting Subcategory')
 
BTS_Projects = my Dataverse table
 
cr622_projectnumber = the logical name of a column in the BTS_Projects table, its actual name is Project Number, and it is a number column type
 
coverProjectNumberDATA.Text = the label containing text that is the project number in text format, and I'm trying to match that to the number column Project Number
 
Consulting Subcategory = is the Dataverse column I want to get the result from; however, Consulting Category is a Choices column, synced with the choice Type of Consulting; the default choice is "General Consulting" so it is never blank.
 
Initially, I had this code in an if-then statement because depending on the resulting Consulting Subcategory, there are different bits of info to display on that same screen. For now, I've brought it back to just the Lookup part to see if I can get that solved first.
 
I have spent a couple of hours with Copilot trying to figure this out, which is how I came to use the logical name for the Project Number column. The end result with Copilot was just taking me in loops.
 
I think this may be too difficult for me because of the problem the Choices column presents. 
 
Anyone have any experience with this?
 
Thanks in advance,
Kristine
 
Categories:
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    Try this for a start
    With(
       {_ProjNo: Value(coverProjectNumberDATA.Text)},
       LookUp(
          BTS_Projects,
          cr622_projectnumber = _ProjNo
       ).'Consulting Subcategory'.Value
    )
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • kristinegriba Profile Picture
    214 on at
    @WarrenBelz Hellooo Warren! I hope you are well, and thank you for your assistance. I have copy-pasted your code snippet into the the text property of my label. Below is an embedded screen capture showing the result:
     
     
    I really feel like I've got something done wrong or that I  have completely falling off the right path with this! 
     
    Thanks again,
    Kristine
     
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    Actually you should need
    With(
       {_ProjNo: Value(coverProjectNumberDATA.Text)},
       LookUp(
          BTS_Projects,
          cr622_projectnumber = _ProjNo
       ).'Consulting Subcategory'.'Type of Consulting'
    )
    or whatever the proper name is for the 'Type of Consulting' field you are looking up in the Choices (see the DisplayFields property of the Combo Box)
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • kristinegriba Profile Picture
    214 on at
    @WarrenBelz Alrighty I copy-pasted that code... I've got two embedded images below.
     
     
    This image shows the name of the Dataverse column so you can see it for yourself:
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    OK - lets start with basics so I am not making incorrect assumptions - what I think I know is correct
    • The code we are working with is in the Text property of a Label called coverProjectNumberDATA
    • You have a Dataverse Table called BTS_Projects with two fields relevant here
      • A Number column cr622_projectnumber
      • A column called 'Consulting Category' which you first said was a Choice column, but also noted that is was referencing a field in another Table (the name does not matter) called 'Type of Consulting' - this would make it a Lookup column, which was my second post
    The part I am unclear on is where Consulting Subcategory comes into all of this. Can you please set out your full data structure (Table and field names and types) for all the fields above and also the Items and DefaultSelectedItems of your Combo Box.
  • kristinegriba Profile Picture
    214 on at
    @WarrenBelz Hi Warren - It is near midnight and I have work tomorrow so if it's okay, I'll reply more fully when I get home from work tomorrow. Thanks again and have a great night... and I'll pull together a more comprehensive reply tomorrow.
  • kristinegriba Profile Picture
    214 on at
    @WarrenBelz Alrighty, I've got a couple more images to give you contact and more info. What you are seeing is a screen shot of a PowerApps screen intended for printing what I call a 'cover sheet.' It gets attached to the box of documents a client may drop off.
     
     
     
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    I thought we would get back to basics here, but this seems to have introduced additional items that are not part of the question you posted. Rather than post screenshots, can you please just respond to the questions I ask - it makes it a lot easier for me as I am trying to troubleshoot this for you.
     
    From the last screenshot, you have a Table called BTS_Projects with two relevant fields
    • 'Project Number' which is a number column
    • 'Consulting subcategory' with is a Lookup column to another Table referencing the field 'Type of Consulting'
    I cannot see 'Consulting Category' in there (you said it was a Choice column) - how is this relevant to your problem - this is the bit I  am unclear on.
     
    From the initial code posted (and you said this was wrong) this should be correct for finding the value in the 'Consulting Subcategory' field of the BTS_Projects where the 'Project Number' is equal to the value in the Text Input. I have a feeling that both Consulting Subcategory' and 'Type of Consulting' may require the correct name.
    With(
       {_ProjNo: Value(coverProjectNumberDATA.Text)},
       LookUp(
          BTS_Projects,
          cr622_projectnumber = _ProjNo
       ).'Consulting Subcategory'.'Type of Consulting'
    )
    Rather than going in circles, can you please list the relevant field names and types in both Tables an confirm (or otherwise) that my assumption on what you are trying to do is correct .
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • kristinegriba Profile Picture
    214 on at
    @WarrenBelz Sorry, Warren, I am not looking to make things worse. Perhaps I am not quite understanding when you use the term 'fields.' When I hear the term 'fields,' I think input box for a user to enter information. So let me try this again...
     
    1. Dataverse table is called BTS_Projects
     
    2. Relevant columns in the table BTS_Projects are:
     
        a. Project Number which is a number type column
            During my trouble shooting, I have tried using this column's logical name instead, cr622_consultingsubcategory, per my interaction with Copilot
         
         b. Consulting Subcategory which I thought was a Choices column (but maybe I should be calling this a Lookup column?)
            
     
          
     
          And Consulting Subcategory is synced with the choice Type of Consulting:
     
       
     
    3. Then, I have a screen in PowerApps called scrIntakePrintCover,
         
         a. There is a Label on this screen called, coverType
             This Label displays whether or not the project is consulting work, corporate tax, valuation work, or regular bookkeeping.
             The Text property of this Label has the following code, and works fine:
    LookUp(BTS_Projects, 'Project Number' = Value(coverProjectNumberDATA.Text), 'Type of Project')
          b There is a second Label on this screen called, print_Consul_subcat_DATA
     
              This Label will display the subcategory of consulting work, if coverType displays the text "Consulting."
     
              It does this by grabbing the project number displayed in the Label, coverProjectNumberDATA, and looking
              that up in the table BTS_Projects, to find the corresponding data entered into the column, Consulting Subcategory.
              It is this Labels code that I need assistance with. Originally I tried using the following code in the Text property:
    LookUp(BTS_Projects, cr622_projectnumber = Value(coverProjectNumberDATA.Text),'Consulting Subcategory')
              But that code seems to trigger the error message, "Invalid data from the network"
     
              I thought perhaps the code for coverType would work here, instead pulling 'Consulting Subcategory' data;
              however, the difference here is that this involves a Choices column type.
     
    I hope I did a better job of communicating the relevant fields, and again, thank you for taking the time. If you think I have missed including any other relevant field information, let me know.
     
    Best,
    Kristine
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    OK - I am asking the wrong questions here - I assume (please correct me if I am wrong) that Copilot wrote this for you and you do not fully understand what I am asking. 
     
    The reason I keep asking questions is that what I posted the second time should be correct based on the information you have given and I am trying to work out what exactly is different from what I have interpreted from your posts. 
     
    You have now told be that this works
    LookUp(
       BTS_Projects, 
       'Project Number' = Value(coverProjectNumberDATA.Text), 
       'Type of Project'
    )
    and that is logical as 'Type of Project' is a Choice column.
     
    Looking at your earlier screen shot again, 'Consulting Subcategory' is also a Choice column, but where is the field 'Type of Consulting' that is it syncing with and why are you syncing with it ?

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard