Hello all,
As I'm very new in Power Automate, I prefek asking before loosing my time finding the operations to achieve this :
I work for a school a we have a hudge database to manage our students and their academic careers (subscriptions, notes, diplomas, etc.)
Has we have many many administratives tasks, I need to automate some using Power Automate and Power Apps. To do that, I can access the datas of our database using rest api calls. These calls return JSON objects.
In the database interface, we are working with views like this :
Each view has a name and some fields (in green ) to filter the results.
So, when I make a rest api call, I need to transmit the view name and I receive a json object containing the technical informations of the view like this :
{
"Id": 1416,
"DataClassId": "Anlass",
"Designation": "PA-Classes",
"SearchFields": [
{
"Id": 0,
"FieldId": "Id1",
"Position": 1,
"Width": 73,
"HeaderText": "ID événement",
"TypeName": "Int32",
"SearchText": null,
"SortDirection": null,
"DropDownItems": null,
"GroupIndex": null,
"PrimaryKeyIndex": null,
"IsListColumn": false,
"Operator": null
},
{
"Id": 49,
"FieldId": "AnlassNr",
"Position": 2,
"Width": 173,
"HeaderText": "Numéro d'événement",
"TypeName": "String",
"SearchText": null,
"SortDirection": "asc",
"DropDownItems": null,
"GroupIndex": null,
"PrimaryKeyIndex": null,
"IsListColumn": false,
"Operator": null
},
{
"Id": 73,
"FieldId": "UNTERRICHTSSPRACHE_BEZEICHNUNG",
"Position": 8,
"Width": 55,
"HeaderText": "Langue d’enseignement",
"TypeName": "String",
"SearchText": null,
"SortDirection": null,
"DropDownItems": [
"Allemand (Suisse)",
"Français",
"Deutsch",
"Französisch",
"Italienisch",
"Bilingue",
"Englisch"
],
"GroupIndex": null,
"PrimaryKeyIndex": null,
"IsListColumn": false,
"Operator": null
},
If I want the data of that view, I've to send back this received objet without any modification. But If i want to add a filter to receive just some specific datas, I need to modify this object and, for the field I want to be filtered, I need to replace the value of the field "SearchText":null, by a value (for example here : "SearchtText":"Englisch",)
So my idea is creating a "kind of function" with Power automate. I would call this Power Automate flow with the full json object, the fiel id I'd like to filter and the value of the filter. In return, I would receive the modified json object ("SearchText":<Value Received in Parameter>,).
Inside my flow, I would make a for each 'SearchField' object until I found the correct id and the modify the field 'SearchText" value.
Do you think It's the best way to achieve this or is there a better solution ?
Thanks to all for your help 🙂
WarrenBelz
146,631
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,991
Most Valuable Professional