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 / Direct coding a table ...
Power Apps
Unanswered

Direct coding a table vs. building one from Dataverse lookups.

(0) ShareShare
ReportReport
Posted on by 26

I have a table in Dataverse that contains, among other things, a text column of screen names to be used for navigation inside Power Apps.

 

In the OnStart property of my app, I can directly code the same information, and it works for navigation.  For simplicity, let's say that I already have screens called "News" and "Sports", and then directly create a table like this:

 

Set(vMyTable,

  Table(

    {Value: "News", Icon: Icon.Newspaper, Screen: News},

    {Value: "Sports", Icon: Icon.Globe, Screen: Sports})

 

When I do that, because the screens, "News" and "Sports" are already created, the resulting table's "Screen" column (if you click on the table variable "vMyTable" to view the contents) is stored within that table as [Control], not as a string.  That actually works for navigation because the Navigate function is looking for a [Control] object (In this case, a Screen object).

 

However, if I try to assemble the same table by doing lookups from Dataverse:

 

Set(vQuestionNumbers, LookUp(QuestionSets, QuestionSetName = vName, SetMembers))//Get the question set members
Set(vQuestionSet, Concat(vQuestionNumbers, Value & ","))//Create a comma-separated string from the set members
Set(vMyTable,With({_items: Split(vQuestionSet,",")},  //Next few lines create a table of info about each question, such as what screen it appears on.
       ForAll(
        Sequence(CountRows(_items)),
            {Screen: (LookUp(Questions, Screen = Last(FirstN(_items).Value).Value, Screen)),  //The value of the "Screen" column in the Questions table.  Note that (_items).Value refers to a specific row, and the extra ".Value" afterward refers to the column called "Value" in that row.  Then the ending "Screen" on that line refers to what column I'm returning the value from.
            Icon: (LookUp(Questions, Screen = Last(FirstN(_items).Value).Value, Icon)),  //The value of the "Icon" column in the Questions table
            Value: Value  //The numeric value of the sequence, effectively making a label so that the selected questions show up as 1,2,3..., rather than the "News" and "Sports" examples above.
            }
            )
    )
)
 
The resulting table is similar to the example above of a directly-created table, BUT the difference is that the "Screen" column doesn't hold an [Control] value, it holds a string.  That string can't be used with the Navigate function because it's expecting an object.
 
So... any ideas how to get around this?  I have to do a lot of manipulation to Get members of a question set from one table, match those up with the questions in another table, and get the names of the screens to navigate to in the app.  I just can't seem to get my programmatically-created table to store the screens as the screen objects, rather than the text of the screen names.
Categories:
I have the same question (0)

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard