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 / Dynamic Gallery and Fo...
Power Apps
Unanswered

Dynamic Gallery and Form Issue for building an Admin App

(0) ShareShare
ReportReport
Posted on by 2
I created an app that depending on the selection in the first gallery, displays the values to allow the admin group to update or add new.  I was able to get the drop down (fact vs dimension) to display correctly, but when I click the table to display the values from the fields, it will not work.  I've tried several different methods consulting with ChatGPT and cannot get it it to display the value.  In troubleshooting, it recognizes the count of values, but does not display the value.  The goal of the app is to display field values that we can edit OR add new values to that table.  We can do this if I create multiple galleries, but I was trying to minimize the amount of work by creating dynamic galleries/forms.
 
Layout:
3 Containers
  1. Drop Down 
  2. 2 Galleries : Admin Selection Fact and Admin Selection Dimension
  3. 2 Galleries and 1 Form:  Gallery_Reference, Gallery_Fact, Form_Editor
On the app onstart, I created a list of tables and fields (example of format below)
ClearCollect(
    colTableFields,
    { TableName: "Service Area", Fields: ["Service Area Name"] },
    { TableName: "Sub-Service Area", Fields: ["Sub-Service Area Name"] },
    { TableName: "OU Portfolios", Fields: ["Portfolio Name"] },
    { TableName: "OKR Vision Houses", Fields: ["Vision House Name"] },
)
 
I have a drop down that is for fact and dimension onchange setting is this:
Set(vartabletype,Dropdown2.Selected.Value)
 
I'm trying to use the switch function to display the value when
AddColumns(
    Switch(
        varSelectedTable,
        "Service Area", 'Service Areas',
        "Sub-Service Area", 'Sub-Service Areas',
        "OU Portfolios", 'OU Portfolios',
        "OKR Vision Houses", 'OKR Vision Houses'
    ),
    "FieldValue",
    Switch(
        varSelectedTable,
        "Service Area", 'Service Areas'.ServiceAreaName,
        "Sub-Service Area", 'Sub-Service Areas'.SubServiceAreaName,
        "OU Portfolios", 'OU Portfolios'.PortfolioName,
        "OKR Vision Houses", 'OKR Vision Houses'.VisionHouseName,
        "OKR Vision Strategies", 'OKR Strategies'.StrategyName 
)
 
The errors I'm getting are:
Error on Service Area Name Unexpected characters. The formula contains 'Service Area Name' where 'Ident' is expected. Expected operator. We expect an operator such as +, *, or & at this point in the formula. Name isn't valid. '_' isn't recognized., Unexpected characters. The formula contains 'BracketOpen' where 'Ident' is expected., Unexpected characters. The formula contains 'BracketOpen' where 'ParenClose' is expected., Unexpected characters. Characters are used in the formula in an unexpected way.
 
Is this something that is not possible?
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi
     
    Quick note, Please... don't float ChatGPT as the solution finder, it never is.. so don't worry about expressing you tried there first.
     
    Next, I do not see any errors, I simply see you saying you have an error, but if this code was producing it, you should see some red underline squiggles., so please share where that is.
     
     
    Question / Detail?
     
    Why are you adding [ ] around the field names when you only have 1? You do not put [] around single things, like that. If you want it to be a table use Table{} not [].
     
    Remove those and see if your problem goes away, if not please share where the error is.
  • DA-30071506-0 Profile Picture
    2 on at
    I originally was trying to get the display with multiple fields, but that wasn't working. 
     
    Picture with lines:
     
    Errors:
    • FieldValue:Expected Identifier Name
    • Fields Underlined: Name isn't valid
    Gallery_Reference.OnSelect setting:
     
     
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi
     
    is FieldValue supposed to be the FieldName?
     
    Don't put it in "" quotes
     
    its 
     
    AddColumns(Table, FieldName, Formula)
     
    I'd need to see the whole thing but remove the double quotes.

    I am actually not sure what you are trying to do. can you paste the whole thing (not a picture) into a Code Snippet and explain what you want in detail so we can fix 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

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard