Skip to main content

On the page in screenshot, I can show how many files there are in message box, but How can I get name of files, and also how can I reach column names, and update their value?

 

for example how can i change the files’s status to “Updated“ from “New”

the folder path is PowerAutomateFiles\AUT0001829

Hi ​@Semih 3318,

 

You can use two methods for this.

 

Method 1: Using the Sharepoint & REST Web Services together

  •  Get file names + item IDs (Microsoft Graph via A360 “REST Web Services”)
  •   Update the Status column for each file

 

Method 2: Using the Sharepoint package alone

  • Get file(s) → loop through the returned list to read file names (dictionary keys documented in the action). 
  • Get list item / Update list item require the list name and item ID; if you don’t have the ID, resolve it via graph as shown above, then call Update list item with column/value pairs (e.g., Status = Updated). 

 


@Padmakumar  Hi,

How can I use sharepoint package here?
I use;
Sharepoint:Authenticate
Sharepoint:Get file(s)
Foop for each item in list

    MessageBox (ListItem)
Here it gives error as 
“content expecting String “received LinkedHashMap”

Edit: Alright. This is dictionary value, thats why. Thanks


@Padmakumar  Hi,

How can I use sharepoint package here?
I use;
Sharepoint:Authenticate
Sharepoint:Get file(s)
Foop for each item in list

    MessageBox (ListItem)
Here it gives error as 
“content expecting String “received LinkedHashMap”



Get file(s) returns a list where each item is a Dictionary containing properties (e.g., file name, URL, last modified time, unique ID). You must Get by key into string variables before sending to Message Box. The official doc notes the output is a List of type Dictionary and suggests looping the list to read filename, URL, last modified time, and unique ID.

 


Thanks ​@Padmakumar  that helps


@Padmakumar  it can read Name, ServerRelativeUrl, TimeLastModified, UniqueId
But i need to read the column values. Is that possible?


@Padmakumar  it can read Name, ServerRelativeUrl, TimeLastModified, UniqueId
But i need to read the column values. Is that possible?

Short answer is not with SharePoint → Get file(s) alone.


That action only returns basic file properties (name, URL, modified time, and unique ID). It does not include your document library columns (metadata). To read columns like Status, you need to pivot to the ListItem behind each file and read its fields. Get list item confirms it returns a list of dictionaries with the list item details; you loop the list and extract fields by key.

If you prefer not to resolve the ID, you can call Get list item → All list items for the library and match by file name (FileLeafRef)—but that’s heavier on large libraries.


The better option for you is to integrate this action along with the SharePoint REST API to get the File and Columns together.


@Padmakumar After get file(s) action, i loop in the list

I get those details as you mentioned. To get column values, should i use Get list item(s), and then what properties can I give to reach column values?

is it possible instead of sharepoint api?


@Padmakumar After get file(s) action, i loop in the list

I get those details as you mentioned. To get column values, should i use Get list item(s), and then what properties can I give to reach column values?

is it possible instead of sharepoint api?

 

  1. Use Get file(s) to list files (you already have NameServerRelativeUrlTimeLastModifiedUniqueId).
  2. Use Get list item on the document library to fetch the list items (files’ metadata rows).
  3. Join the two by matching ServerRelativeUrl ⇔ FileRef (or Name ⇔ FileLeafRef), then read your columns from the list item dictionary.

is there any document about these two which i couldnt get it worked?
 

  1. Use Get list item on the document library to fetch the list items (files’ metadata rows).
  2. Join the two by matching ServerRelativeUrl ⇔ FileRef (or Name ⇔ FileLeafRef), then read your columns from the list item dictionary.
    for example  for get list item(s) action , what should i type as List name? is it listitem(Name)?

    and when i get matchedRecords from get list item(s)
    How to show their values in messageBox? 

is there any document about these two which i couldnt get it worked?
 

  1. Use Get list item on the document library to fetch the list items (files’ metadata rows).
  2. Join the two by matching ServerRelativeUrl ⇔ FileRef (or Name ⇔ FileLeafRef), then read your columns from the list item dictionary.
    for example  for get list item(s) action , what should i type as List name? is it listitem(Name)?

    and when i get matchedRecords from get list item(s)
    How to show their values in messageBox? 

 

 

1. What to type in “List name”

  • Use the document library name (the same name you see in the SharePoint UI, e.g., DocumentsInvoices, etc.).
  • Do not type listItem(Name) or the file name.
  • Example: If your files are in Shared Documents, the list name is usually Documents (or whatever your library is called).

2. What “Get list item(s)” returns

  • It returns a List of Dictionary.
  • Each dictionary represents one row (one file’s metadata).
  • Keys in the dictionary are the internal column names:
    • ID → List item ID
    • FileRef → Full path
    • FileLeafRef → File name
    • Your custom columns (e.g., Status or Import_x0020_Status)

3. How to show values in Message Box

You cannot show the whole dictionary directly (Message Box expects String).
Instead:

  • Loop through the matchedRecords list.
  • Assign CurrentItem to a Dictionary variable (e.g., dict_Item).
  • Use Dictionary: Get by key to extract values into String variables.
  • Then show them in Message Box.

Example:

Loop: For each item in matchedRecords
CurrentItem → dict_Item (Dictionary)

Dictionary: key → FileLeafRef, Value → sName
Dictionary: key → sStatus, Value → sStatus

Message Box → File: sName,
Status: sStatus
End Loop

4. How to join with Get file(s)

  • Get file(s) gives you ServerRelativeUrl.
  • Get list item(s) gives you FileRef.
  • These two usually match (or you can match by FileLeafRef = file name).
  • So:
    • Build a Dictionary mapping FileRef → dict_Item (list item dictionary).
    • Then when looping files, look up the matching list item and read columns.

5. Updating a column

Use Update list item:

  • List name = same library name.
  • List item ID = value from dict_Item["ID"].
  • Columns = add entry: Name = "Status"Value = "Updated".

 

If your column display name is Import Status, the internal name is likely Import_x0020_Status.
Check it in SharePoint:

  • Go to List settings → click the column → look at URL after Field=.

But Listname is a variable which is created in automation anywhere. So we can not give folder name like SharedDocuments etc, its folder name.
Here list name is used as a list variable https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/using-the-workbench/sharepoint-get-listitem.html