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 Apps
Unanswered

Hardcode

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello

I am trying to find a solutions to hardcoding.......and not sure the best method.

I have 1 screen where I have 1 form and created tabs..(varTabForm)

raewyne_0-1628715236629.png

I have made fields visible based on which tab is selected....

In my sharepoint list, I have a choice column (Engagement Activity) that has all the tab names.

When the form is submitted from any tab, I want the choice field to show the tab name in that field.

Do I leave it as a choice field and if so, what is the solution, or

Do I change the choice field to a text field and somehow hardcode on the form to when the tab is selected to write the tab name to the text field..... I'm lost on how to do this and would appreciate some assistance.

thanks

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    How are you creating your tabs?  If they are part of a Gallery, then you can simply reference the selected item from the gallery to determine the value.  No need to hard-code anything in.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes , Hi Randy, the tabs are created from a button

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Are they in a Gallery? Or have you made individual free standing button controls for each one?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes Individual ones, although I'm thinking perhaps I should change to gallery, what are your thoughts?

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Most definitely a Gallery!!!

    Put an empty horizontal gallery on your screen and set the Items property to:

       ["Risk Assessment", "Risk Training", "Project Participation", "Document Review", "Artefact Request", "Forum Facilitation", "Admin"]

    This would be a basic starting point for your Items property.  I typically pack the Items property with lots of other columns that are then used to control the screens, forms, controls, etc.  But let's start you with the basics.

    Now, copy one of your existing Buttons into your new gallery.  Set the Text property of the Button to : ThisItem.Value  

    Change the size of the template as you need to give you the look you want like what you have now.

    Get rid of the other buttons.

     

    Now...any place in your app that you want to know the selected tab, just reference the Gallery.

    Example, if you have something that should only be visible for the Admin tab, then set the Visible property of that control to : yourNewTabGallery.Selected.Value = "Admin"

     

    And back to your original post - you can now reference the selected tab in your form in order to submit it back to the list.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes , you have been so helpful Randy, not just this question but others, thank you so much for taking the time to help me....

    I will hop back on the powerapps tonight and change the design based on your feedback

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Sounds good and - always happy to help!!

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

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard