cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TxSteve
Level: Powered On

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

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

4 REPLIES 4
PavanKumar
Level 8

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

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

 

Community Support Team
Community Support Team

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

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TxSteve
Level: Powered On

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

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
Level: Powered On

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

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,546)