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 / default text value by ...
Power Apps
Answered

default text value by the result of a pervious dropbox

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am working on an attendance record sheet. Which I have created a drop box of selecting different shift name, like E4=evening 4pm. However, I would like to default fill in roster in and roster out time by the selected result in the drop box. I tried to use an If clause :

If(DatacardValue15.Selected.Shift="M4", "0400"

It only worked for one shift, how can I make it for different shift fill in different roster time.

Categories:
  • Verified answer
    Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi,

    Try this,

    If(DatacardValue15.Selected.Shift = "M4", "0400",
    DatacardValue15.Selected.Shift = "E4", "1600",
    DatacardValue15.Selected.Shift = "N4", "2400", "0000" )

    Thanks!

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • Talha_Dar Profile Picture
    870 Super User 2024 Season 1 on at

    Hi @Anonymous,

     

    Are you using a SharePoint list to populate the values in the dropdown? Are the values 'M4' and '0400' defined in the same record? And do you want to set the default property of your dropdown based on the data from this record?"

    Additionally, my question to you is: Would you like to customize the default property of the dropdown based on the record data?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The dropbox value is from an excel local file which the table only include the shift time. And the roster time in time out are the column from list which which is a text input box only. Both are separated. 
    I would like to have default roster time in time out based on what I selected in the dropbox. 

    Annotation 2023-07-19 220823.png
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, I have tried like this for all the possible shift: If(DatacardValue15.Selected.Shift = "M4", "0430",
    DatacardValue15.Selected.Shift = "M6", "0600",
    DatacardValue15.Selected.Shift = "M9", "0900",
    DatacardValue15.Selected.Shift = "M10", "1000",
    DatacardValue15.Selected.Shift = "M12", "1200",
    DatacardValue15.Selected.Shift = "E1", "1300",
    DatacardValue15.Selected.Shift = "E2", "1400",
    DatacardValue15.Selected.Shift = "E4", "1600",
    DatacardValue15.Selected.Shift = "E7", "1930",
    DatacardValue15.Selected.Shift = "A", "0800")


    But it shows error.

    Annotation 2023-07-19 221617.png
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Try this formula

    Switch(
    DatacardValue15.Selected.Shift,
    "M4", "0430",
    "M6", "0600",
    "M9", "0900",
    "M10", "1000",
    "M12", "1200",
    "E1", "1300",
    "E2", "1400",
    "E4", "1600",
    "E7", "1930",
    "A", "0800",
    ""
    )

    Thanks!

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard