Help needed: Nested Rest API calls - e.g. Netbox #287
-
What is my Problem? In my case, i'm having one field for a virtual machine and another one which gives me all related contacts for this vm. These contact assignments returns something like:
But in my form i want to extract all contacts with their internal ID Number, which is an custom field in Netbox. Possible Solution? But then i have to do a "like" for each over this array. Make an rest call for each contact assignment and build some kind of array with additional informations. Do someone have an idea how to solve this or solved an slightly different issue? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
in this particular case i would suggest to write your own backend function. AF loads or allows to load a custom functions library exposed as fnc. steal the code from the regular functions. let me know if you need more help. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/ansibleguy76/ansibleforms-docker/blob/main/data/functions/custom.js |
Beta Was this translation helpful? Give feedback.
-
and steal from https://github.com/ansibleguy76/ansibleforms/blob/main/server/src/functions/default.js |
Beta Was this translation helpful? Give feedback.
https://github.com/ansibleguy76/ansibleforms-docker/blob/main/data/functions/custom.js