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 / Can you use a Choice f...
Power Apps
Unanswered

Can you use a Choice field (Yes/No) to Populate User Name (Created By) and a Date/Time

(0) ShareShare
ReportReport
Posted on by 8

I have a choice field for a user:

Do you have an issue to report: (Choice) Yes or No

 

If the user selects Yes, is there a way to auto-populate 2 other fields (Created By and Today's Date/Time). It would look similar to this.

 

Do you have an Issue to Report (Yes/No)      Reported By:          Date/Time:

                         Yes                                          Doe, John          11/11/2019  8:00 am

Categories:
I have the same question (0)
  • PavanKumar Profile Picture
    479 on at

    Hi @TxSteve 

     

    Yes you can definitely do that. Please follow below instructions

     

    If you want to display Created by and Date/Time fields which you have already populated then do the below:

    - Onvisible property of Createdby and Date/time fields change to issureported.selected.value(issuereport is name of your checkbox or radiobutton field).

     

    if you want to populate data for Created by and Date/time fields upon selection of issue reported field then:

    - onselect property of issuereported field set the condition If(Issuereported.selected.value = true,populated data in Created by and Date/time fields,"");

     

    If this answers your question give a thumbs up and mark it as verified.

    Regards,

    Pavan Kumar Garlapati

     

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @TxSteve ,

    Firstly, created by is a system field, you can not update by yourself or decide whether you update it.

    It will automatically generate everytime you create a new record, no matter what data is in the record.

    So if you want to update two fields based on one condition, you need to update custom fields, not using the same name with system field.

     

    Could you tell me what control that you use to update the choice column?

    I assume that you use a toggle to update.

    For example, I create one field named whocreated (person data type), one field named whencreated(date time type)

    Set the patch button's OnSelect:

     

    If(toggle1.Value=true, 
    Patch(listname,Defaults(listname),{'Do you have an Issue to Report':{Value:toggle1.Value},
    whocreated:

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & User().Email, Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"", Picture:""} ,
    whencreated:Now()
    }
    )
    )

     

     

     

    Best regards,

  • TxSteve Profile Picture
    8 on at

    Good morning, I think we are close, but I need a little help making this fit my form.

    I am implementing this to the Add New Item form. The form is linked to my SharePoint List called "Products". 

     

    My 3 fields on the form are;

    • (Choice Data Type) DataCardValue32 - Values Yes and No
    • (Person Data Type) DataCardValue31 (displayname)
    • (Date Data Type) 
      • DateValue5
      • HourValue5 
      • MinuteValue5
    If(toggle1.Value=true, 
    Patch(listname,Defaults(listname),{'Do you have an Issue to Report':{Value:toggle1.Value},
    whocreated:

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & User().Email, Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"", Picture:""} ,
    whencreated:Now()
    }
    )
    )
  • TxSteve Profile Picture
    8 on at

    I'm still looking for a little more help on this please. Being new to PowerApps, not sure of how to edit the suggestion to work with a choice field. I also added a bit more information about the other fields that I have. -Thank you

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard