Flow designer- how to calculate total disk space on a server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2021 01:24 AM
I am trying to figure out how I can create an action in flow designer that wil get me the total disk space on a server.
example:
The server has 3 disks that have different sizes (100, 200 and 300 Gb) that totales to 600 Gb.
I would like to sum these values when different servers have different number of disks?
When I get the total I can use this value further down my flow.
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2021 04:26 AM
When you upgrade to Quebec you'll have "flow variables" that you can use for this purpose.
There's a couple of workarounds you can use in Paris, but none of them are great. You can use the inline scripting to calculate it later when you need it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2021 08:51 AM
I have now upgraded my personal instance to quebec, but I have an issue with my solution.
How do I get the variable to be the sum of "lookup records"?
I guess I need some sort of adding all the sizes found in the lookup action, it doesn't work if I use "sum" in transformation 😉
Somehow I need to build the array or do the math for each step.
This is how I imagine a flow for calculating disk space on a server:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2021 03:57 AM
Edit: forgive the typo of "totalDiskpace"... I only realised I'd missed the s after I'd done the screenshots :-).
Size is actually a string field that's calculated on save, you'll want to do something like this to add up the bytes:
And then you can use that value with the OOB script include that the size field uses, like this:
Which returns:
In this example I had two storage devices, one with 20 million bytes, and another with 50 million.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2021 07:48 PM
One way you can do this is by creating a custom action to be used in your flow.
Based on your use case:
- Create 3 action inputs, disk1, disk2, and disk3
- Create a script step
- Configure it like this:
24. Here's the script for reference:
a
(function execute(inputs, outputs) {
var num1 = parseInt(inputs.disk1);
var num2 = parseInt(inputs.disk2);
var num3 = parseInt(inputs.disk3);
var sum = num1+num2+num3;
outputs.totaldisk = sum;
})(inputs, outputs);
45. Create an output that takes the sum from the script step
56. You can then use the output to use in your flow to update a field.
57. Remember that you're passing the variable of disk 1 size, disk 2 size and disk 3 size from your initial flow to the inputs you've created.
Hope this solves your issue.