Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SxAOCqrjA93PCveX8fsIFV
Power Apps - Building Power Apps
Answered

Auto Populating a Field

Like (0) ShareShare
ReportReport
Posted on 15 Nov 2022 16:37:00 by 240

Hello everyone,

 

Hope you are doing well!

 

Could someone possibly advise me how I can auto-populate a field within a form based on a criteria.

 

For example here, I would like 'system' to be populated with a choice if Employee id is completed with something beginning with 4 i want system to be auto populated, the same if Employee ID is populated with something beginning with E i want system to be populated with something else.

 

Appy1_0-1668530005023.png

I also have another question, it is if my form field of 'Logging Person' could be completed by the app recognising who has logged on to complete the form? and if so how to do this.

Appy1_1-1668530156139.png

 

Thank you very much!

Chris

 

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    146,679 Most Valuable Professional on 17 Nov 2022 at 19:50:47
    Re: Auto Populating a Field

    Hi @Appy1 ,

    DefaultSelectedItems of Combo Box DataCardValue16 (you might look at some naming protocols for your controls)

    {
     Value:
     If(
     StartsWith(
     DataCardValue1,
     "4"
     ),
     "System1,
     StartsWith(
     DataCardValue1,
     "E"
     ),
     "System2,
     . . . . . 
     )
    }

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • CC-19121430-0 Profile Picture
    240 on 17 Nov 2022 at 14:49:38
    Re: Auto Populating a Field

    Hi @WarrenBelz,

    Thanks for your reply and apologies, I will try my best to explain exactly.

    I want to be able to populate a DataCardValue within a form (Form1).


    If EmployeeID is completed with a number beginning with 4, i know that employee ID sits within a certain system for example 'System1', if it begins with the letter E, i know that it belongs to another system 'System2'.


    I was hoping to pre-populate this to speed up the completion for whoever uses my form.

    Items within my DataCardValue are currently just the selections of system written as ["","System1","System2", "Both"].

    Appy1_0-1668696486844.png


    Many thanks for taking a look.
    Chris

  • WarrenBelz Profile Picture
    146,679 Most Valuable Professional on 16 Nov 2022 at 20:46:06
    Re: Auto Populating a Field

    Hi @Appy1 ,

    Can you please provide more detail on the first question - what do you want populated in System and how are you then specifying what it is ? Also what are the Items of the Combo Box, its name and the name and type of field you are writing back to ?

  • CC-19121430-0 Profile Picture
    240 on 16 Nov 2022 at 11:22:40
    Re: Auto Populating a Field

    Hi @WarrenBelz 
    Do you have any advice on this one?
    Thanks

    Chris

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 15 Nov 2022 at 18:32:47
    Re: Auto Populating a Field

    @Appy1 

    I can't answer the first question but User().FullName to fill in the logged in user.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started