Forum Discussion
Automatically Rename Files in Sharepoint from lookup column
hi dj1996
it might depend which information from the lookup list is returned.
You should see three potential options within your Cloud Flow for the Vendor column.
The ID, the value and the 'complete field'.
In case the value you see here (respectively within the SharePoint library) fits the vendor name already, you can refer to it for your file name.
Otherwise you might think about getting all potential vendors first and filter those based on the ID of your lookup, which is the list item ID of the lookup lists entry.
The following is what you get in return from a lookup column.
The ID is the record ID of the SharePoint list you perform the lookup against.
The value is the column within the lookup list you get the value from (e.g. Title).
"lookupColumn": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "demo"
- dj1996May 18, 2023Copper Contributor
Hi Micca0815
Thanks for your response. Unfortunately, selecting the 'value' field creates another 'apply to each' function within the current 'apply to each' function, within another 'apply to each' function.
Which then gives me this error:- Micca0815Nov 02, 2023Iron ContributorThe first apply to each should be done for all items you get in return with your get file (properties only) action.
For the body of the HTTP action you could reference the vendor value for the current item of your get files (properties only) action as follows:
- HTTP body somehow with the following pattern:
.... 'FileLeafRef': items('Apply_to_each')?['VendorColumn']?['VendorColumnValue'] ....