cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Auto-fill field with 'Created by'

Hello there, 

 

I just need some help with how to auto-fill a field. 

I have a Sharepoint list which contains a "Reported by" column, in my app, I'd like it to work so when people start a new form, that "Reported by" column auto-fills with whoever is filling out the form, so with the "Created by" info. I tried doing this by going to the default property and trying "This item. 'Created by'" in my Reported by field, but it isn't accepting the value. Help would be appreciated, thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @TorreyFalconer 

 

You are using the title field, which is a single line of text field

 

If(
    formname.Mode = FormMode.New,
   User().Email,
    ThisItem.Title)

View solution in original post

9 REPLIES 9
Highlighted
Dual Super User II
Dual Super User II

Hi @TorreyFalconer 

 

For the default property of the data card use,

If(
    formname.Mode = FormMode.New,
    {
        DisplayName: User().FullName,
        Claims: "i:0#.f|membership|" & User().Email
    },
    ThisItem.ReportedBy)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted

@RezaDorraniI have done so on the default value of the data card and it says it is an invalid argument type. Is there anything else I should be adding? 

 

Annotation 2019-09-16 110324.png

 

 

Highlighted

Hi @TorreyFalconer 

 

formname should be replaced with your form control name

reportedby should be replaced with the reported by field referance in your app

 

I just gave an example

 

Highlighted

@RezaDorranithanks, still a no go:

 

Annotation 2019-09-16 112616.png

Highlighted

Hi @TorreyFalconer 

 

I just tested this and it works fine

 

are you applying this on the data card or the control?

what is the type of field for this data card?

 

share screen shot of data card along with column type showcasing where this formula is used

Highlighted

Highlighted

Hi @TorreyFalconer 

 

You are using the title field, which is a single line of text field

 

If(
    formname.Mode = FormMode.New,
   User().Email,
    ThisItem.Title)

View solution in original post

Highlighted

Almost there! I thought maybe that had something to do with it, I renamed the title field "Reported by".

One more thing: the email of the user is showing up, is there any way for that just to be the name?

 

 

Highlighted

Hi @TorreyFalconer 

 

replace User().Email with User().FullName

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (3,488)