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 / Getting blank output f...
Power Apps
Suggested Answer

Getting blank output from vertical gallery

(1) ShareShare
ReportReport
Posted on by 19
I'm getting blank output from a bvertical gallery that pulls data from multiple SharePoint list. 
 
The Outcome I'm looking for:
 
When you select an FPID(which is the only field in gallery A) within vertical gallery A it outputs all the data that's tied to the selected FPID into gallery B.
 
That said, I'm at the step of inputting the code into gallery b items property and when you enter ThisItem.Permit_Name it's blank. See code below for details.
 
My question here is, what am I not seeing/doing to get no data returned?
 
The code ungroups a table, addcolumns the columns from multiple list, and within that list I filter out the FPID.
 
Code: 
Ungroup(
    Table(
        // Environmental Permits
        {
            Permits: AddColumns(
                Filter(EnvironmentalPermits, FPID = varSelectedFPID),
                Permit_Name, 'Permit Name',
                Permit_Number, 'Permit Number',
                Permit_Type, PermitType.Value,
                Issue_Date, IssueDate,
                Expiration_Date, ExpirationDate,
                Extension_Date, ExtensionDate,
                Status_, Status.Value
            )
        },
 
        // Permit History
        {
            Permits: AddColumns(
                Filter(PermitHistory, FPID = varSelectedFPID),
                Event_Type, EventType.Value,
                Agency_Date, EventDate
            )
        },
 
        // Project Info
        {
            Permits: AddColumns(
                Filter('Project Info', FPID = varSelectedFPID),
                Comments, 'Project Comments',
                Project_Description, 'Project Description',
                Permit_Lead, 'Permit Lead'.DisplayName
            )
        }
    ),
    Permits
)
I have the same question (0)
  • Haque Profile Picture
    443 on at
     
    let's review the syntax:
     
    In the first place,
     
    AddColumnsThe syntax for AddColumns is: 
    AddColumns(SourceTable, "NewColumnName1", Expression1,
                            "NewColumnName2", Expression2,
                            "NewColumnName3", Expression3...)

    In your code, you are passing column names without quotes (e.g., Permit_Name, 'Permit Name'), which is invalid. The new column names must be strings (in quotes), and the expressions must be valid formulas or references.
     
    In the second place, how we are referencing columns inside AddColumns:
    Probably you  are mixing column names and values incorrectly. As an example, 'Permit Name' is suppose to be a column name, but you are using it as a value expression. You should use ThisRecord.'Permit Name' or just 'Permit Name' (if it's a column in the source table) as the expression.
     
    In the third place, I suspect there are some  inconsistent naming and usage, in my view some columns like PermitType.Value and Status.Value suggest these are choice fields or records, so you need to ensure you access them correctly.
     
    To narrow down the issue, let's try this first:
    AddColumns(
        Filter(EnvironmentalPermits, FPID = varSelectedFPID),
        "Permit_Name", 'Permit Name',
        "Permit_Number", 'Permit Number',
        "Permit_Type", PermitType.Value,
        "Issue_Date", IssueDate,
        "Expiration_Date", ExpirationDate,
        "Extension_Date", ExtensionDate,
        "Status_", Status.Value
    )
    
     
    Please let me know if this helps.
     
     
     
  • TS-17021950-0 Profile Picture
    19 on at
    I tried the above to no avail. See screenshot below using the code supplied.
     
  • Haque Profile Picture
    443 on at
     
    I just pointed one area last time not the entire code, let's review other areas:
     
    Again - first of all, apply similar fixes to the other two AddColumns calls with quotes and values. More precisely, rest of the two places one is Permit History and the other is Project Info.
     
    Once you do that for all AddColumns call, one other area I suspect and need investigation which is usage of Ungroup! Apparently, you are creating a table of records each with a Permits column that in turn contains a table, then ungrouping by Permits. To some context this is may be correct in principle, but, to  me it seems, the inner tables must be properly constructed.
     
    What does that mean (inner tables must be properly constructed)?
     
    It means for each inner table, we must check  it is well-formed table of records with correctly quoted new column names and valid expressions, so that when you combine them with Table() and then Ungroup(), the data merges correctly. Let's go to a microscopic lab for a side by side view:
     
    Side by
     
     
    Please let me know if this works.
     
     
  • TS-17021950-0 Profile Picture
    19 on at
    I tried the revised code and it does not work. 
     
    Is there another way to complete this task as the one chosen is giving to much of an issue?
     
    See revised code error:
  • Suggested answer
    Haque Profile Picture
    443 on at
     
    Let's be bit tenacious and dive into bit deeper - can you please check below reaons?
     

    One of the reasons may be ThisItem.Permit_Name is blank in Gallery B is likely because the Items property of Gallery B is not set to a collection or table that contains a Permit_Name column directly.

    Since you want Gallery B to show all data tied to the selected FPID from Gallery A, you need to set Gallery B’s Items property to a formula that filters your combined data source by the selected FPID from Gallery A.

    For example, if you have a combined data source (like the ungrouped table from your earlier Ungroup formula), and Gallery A’s selected item is GalleryA.Selected, then Gallery B’s Items property should be something like:

    Filter(CombinedDataSource, FPID = GalleryA.Selected.FPID)
    
     
    Note:
    CombinedDataSource is the table that contains all your permits, histories, and project info combined and ungrouped. FPID is the field you are filtering on. GalleryA.Selected.FPID is the currently selected FPID in Gallery A.
     
  • CarlosFigueira Profile Picture
    Microsoft Employee on at
    Hello @TS-17021950-0, do the tables 'PermitHistory' and 'Project Info' have a column Permit_Name? If they don't, then all items that come from those tables will have the column 'Permit_Name' set to blank - when you "Ungroup" tables with different schema (which is the case of the three tables in your example), columns that don't exist in those tables will have a value of blank.
     
    For example, the result of this expression:
    Ungroup(
        Table(
            { column: [{ a: 1, b: 2 }] },
            { column: [{ a: 3, c: 4 }] },
            { column: [{ a: 5, d: 6 }] }
        ),
        column
    )
     
    Will be the table below:
    a b c d
    1 2    
    3   4  
    5     6
     
    Notice that the values for the column 'b' (which exists in the first table, but not in the other 2) will be blank for the second and third rows.
  • WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at
    Just coming in to clarify a couple of things that should get this back on track.
    • You do not need quotes "" around the new column names when using AddColumns - your posted syntax is correct (the requirement for this was changed some time back).
    • @CarlosFigueira may be correct here as to some blank values - your code appends each data set and will display all column names that exist in any of the three different iterations - so if the field does not exist in any of them, it will show as blank in the end result.
    • On a minor note, you do not need to Ungroup - just collect the three Tables (and delete the Permits: reference).
  • TS-17021950-0 Profile Picture
    19 on at
     
    You are correct. Each list has different columns. Hence, me looking to merge all the information from the specific FPID into one row, and not have blank values. 
    With that in mind,  are you saying add a Remove() to get rid of the blank values?
     
    If there's an easier way of accomplishing the goal, I'm for it.
     
     
  • Suggested answer
    WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at
    Now I see what you are doing here, I would approach this quite differently as below - you only need one table - just add the extra fields to the primary table based on their matching record in the other two.
    AddColumns(
       RenameColumns(
          Filter(
             EnvironmentalPermits, 
             FPID = varSelectedFPID
          ),
          'Permit Name', 
          Permit_Name, 
          'Permit Number', 
          Permit_Number, 
          IssueDate, 
          Issue_Date, 
          ExpirationDate, 
          Expiration_Date, 
          ExtensionDate, 
          Extension_Date
       ),
       Permit_Type, 
       PermitType.Value,
       Status_, 
       Status.Value,
       Event_Type, 
       Lookup(
          PermitHistory, 
          FPID = varSelectedFPID
       ).EventType.Value,
       Agency_Date, 
       Lookup(
          PermitHistory, 
          FPID = varSelectedFPID
       ).EventDate,
       Comments, 
       LookUp(
          'Project Info', 
          FPID = varSelectedFPID
       ).'Project Comments',
       Project_Description, 
       LookUp(
          'Project Info', 
          FPID = varSelectedFPID
       ).'Project Description',
       Permit_Lead, 
       LookUp(
          'Project Info', 
          FPID = varSelectedFPID
       ).'Permit Lead'.DisplayName
    )
     
    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  
  • WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    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   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#2
Haque Profile Picture

Haque 69

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard