cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
Responsive Resident
Responsive Resident

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

 

Highlighted
Community Support
Community Support

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.
Highlighted
Regular Visitor

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()
}
)
)
Highlighted
Regular Visitor

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,034)