LastModifiedByUser - not able to fetch in sharepoint files

When I tried “DriveItem.LastModifiedByUser”.
with assigning it a variable of “Microsoft.Graph.User” DataType.
It throws, object reference not set to an instance of an object.
Can someone please help.

Hello @Vishnu_Pradhaban
Refer to this thread, you may get some idea

I can get the “LastModifiedDate” pretty well. But i am facing problem when i try to get the “LastModifiedByUser”

@Vishnu_Pradhaban, Kindly check the variable. It seems like the Variable is passing the null value.

Hi @Vishnu_Pradhaban

Here are the steps to fetch the “LastModifiedByUser” property:

  1. Install office.0365 package & Drag and drop the “SharePoint Application Scope” activity onto your workflow and provide the necessary authentication details to connect to SharePoint.
  2. Add a “Get File Properties” activity within the SharePoint Application Scope activity.
  3. In the “Get File Properties” activity, specify the SharePoint site URL and the file path of the file whose properties you want to fetch.
  4. Click on the “Output” property field of the activity and click on “Add Field”. Add the field “Editor”.
  5. Now the “Editor” field will contain the name of the user who last modified the file.
  6. You can store this value in a variable or use it in subsequent activities.

Regards,
Kaviyarasu N

I have used installed Microsoft 365 pacakge.
I have Use Onedrive/Sharepoint activity. Not no SharePoint Application Scope activity.

But primarily, If i am using Find Files/Folders activity and able to get LastModifiedDate details, why not LastModifiedByUser details.

Will be helpful, if somebody guide me in this.

I have assigned “new User” as a default value for this variable.
Even after assigning this, i am either getting “Object reference not set to an instance” Error. or a empty log Message.

Inform me if this is incorrect.

@Vishnu_Pradhaban , If Possible. Share the Screenshot of the flow and variables. it helps us to understand the issue.

There is no GetFileProperty activities in Sharepoint Application scope
Correct e if i am wrong


m

Can you put the exact package name here?
I dont find the pacakge name that you mentioned above

@Vishnu_Pradhaban , Maybe the find Folders and Folders Returns an empty data. From properties, create the variable for the result and print the Count, before the VarResult1
Example: VarResult2.Count.tostring
If it has 0, it means it returns an empty value.

As i already said, i am able to fetch the lastmodifieddate info. I am pretty sure, this SP folder contains some files.
Heres is the screen shot, it has 2 files. and i am able to get the LastModifiedDateTime also.
But only problem is that I can’t get the LastModifiedByUser information.

Somebody please guide me.

@Vishnu_Pradhaban
Try this anyone of this

Var1.LastModifiedBy.User
Var1.LastModifiedBy.User.Tostring
Var1.LastModifiedBy.User.DisplayName
Var1.LastModifiedByUser.GivenName
Var1.LastModifiedByUser.DisplayName

Hi…

First of all thanks.

“Var1.LastModifiedBy.User.DisplayName” — this actually worked. But partially, in the sense it gives me the display name but not the Mail ID.

But its ok. By the way, any ways to get the exact mail ID of that person??

@Vishnu_Pradhaban
Try this

Var1.LastModifiedByUser.Mail
Var1.LastModifiedBy.User.ID

I have already tried this. This throws error.

Anyway, i was able to use invoke python code to check the mentioned user’s displayname is available in the AD group or not.

Thanks anyways

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.