Hi All,
I have a use case where in i would want to check dynamically in a document library if a column exists in that particular library and if not create that particular column.
is that possible through power automate?
Any help would be appreciated.
Hi @Jayant_2203,
Yes, that would be possible. You could retrieve the existing columns via an Send an HTTP action and the Fields method in the REST API and use a filter array to check if your custom column already exists.
Below is an example of that approach.
1. Send an HTTP request uses this URI. In this example I am using a string variable ListName which is storing the name of the list.
_api/web/lists/getbytitle('@{variables('ListName')}')/Fields
2. Filter Array uses the results collection of the output body.
outputs('Send_an_HTTP_request_to_SharePoint')['body']['d']['results']
In the where I am comparing the InternalName of the field to the name of our custom field. In my example that name is stored in a string variable called FieldName.
item()['InternalName']
When the output of the Filter Array is empty you could create the new column.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
30 | |
29 | |
28 | |
20 | |
11 |