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 / Set default value for ...
Power Apps
Answered

Set default value for a combobox

(0) ShareShare
ReportReport
Posted on by 11

I'm creating an app for tracking visitors to our various facilities.  I added a single SharePoint online list. There are 3 special columns that I need help with.

  • a choice field for Building which is a required field
  • a Yes/No field for Check out
  • a date/time column for check-out date & time

I'm planning on creating separate apps for each building.  Right now I just have the one app for our Corporate Office. They will all have a different Welcome screen with a picture of the building and a "Welcome to ____________ (name of building). The welcome screen will have 2 buttons: check-in, check-out. The Check-in button does a newform. (The create date/time field serves as the check-in date/time field.) 

 

On the Newform, I want it to default the building value when new list items are added.  But I can't figure out how to assign the default value to the building column.  Originally, the combobox had Parent.Default for the Default property.  I tried changing it to "Corporate Office" but that didn't work.  I then tried If( IsBlank(Parent.Default),"Corporate Office", Parent.Default) but I'm getting invalid argument type (Record). Expecting a text value instead.

 

So #1 I need help with setting a default value.

 

The check-out button will go to a browse screen that is filtered to display only users where Checkout is false (yes/no field) and Building="Corporate Office".  (This is working) You then select a person on the list and it brings up an edit form.  All the user has to do is change the slider on the check-out button and save.  When they set the slider to yes/on, I would like it to populate the checkout date/time column automatically.

 

So #2, I need direction on how to go about automatically populating the date/time when the slider is turned on.

 

My preference is to display the check out time on the screen in case the visitor left by a different door and the receptionist has to guess on the time, thereby overriding the automated check out time value.  If this isn't feasible, I'll leave the check out date/time off the screen and create a flow to update the time.  The receptionist will have to access the list to correct the time (which is probably not likely to happen.)

 

The actual SharePoint list will be used for exception handling, querying who has visited, finding visitors regardless of building they are in, etc.

 

Categories:
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @forbesn

     

    For #1

    I suggest using simple text column in SharePoint list and not Choice filed. It will work way better. You can add a custom DropDown which will populate the SharePoint list with only values you allow. The Items in the dropdown can be added manually or from excel list.

     

    For #2

     

    Assuming you have checkout time column in your SharePoint list you can add this function to your Submit button (the one that submits the form) just before the SubmitForm() action:

     

    UpdateContext(
     {
     _CheckOutTime:Now()
     }
    );

    Now add the Checkout time datacard in the form and change its Default to

    _CheckOutTime

    Now you can make this datacard invisible since people will not be entering anything here.

     

  • forbesn Profile Picture
    11 on at

    Thanks.  Those suggestions helped.

     

    I ran into one other issue.  It appears that Powerapps is saving the time as Pacific and I am in Central time zone. (time is -2 hours off when displayed in SharePoint but is correct when viewed on the app.)  There are numerous posts on this issue. 

     

    Right now most of our offices are in central time zone so I could just add 2 hours to all my time fields when I save them then when I display them in Powerapps I have to subtract 2 hours but it will be right in SharePoint. 

     

    Since each office will have a unique app that can pretty much be handled in the code except that for the Check In time I was using the Created column.  Is there a way to adjust the value in that coumn?  If not, I guess I add a new column and default the time to the save time (+2 hours) on the check in form.

     

    Another solution I have seen is to save everything back to UTC time but it doesn't look like it will be any less work - it appears it will actually be more work since I'll have to convert the display times in Powerapps and SharePoint.

     

    Is Microsoft working on a solution for that?

     

     

     

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard