Batch GET via OData?

I’m trying to mimic a function in IFS Cloud to find which PMs and by extension which functional objects are using a certain work task Template, but the client uses a batch call to get the list I’m looking for. I’ve tried setting it up with a custom request, but the problem is changing the Content-Type from application/json to multipart/mixed.

Flow does not let me use the header Content-Type, saying “[…] Misused header name […] Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage […]”

And if I omit the header, IFS responds with “Content-type at line ‘0’ should be ‘multipart/mixed’ but is ‘application/json’”.

So is it at all possible to make a batch call from Flow? The alternative is to fetch every single PM (at the moment > 25 000) and compare with the PMs connected to the task template in Flow, since there are too many IDs to fit in a condition (URI too long).

What’s the call IFS does?

It first does WorkTaskTemplateHandling.svc/GetNavigationUrl to retrieve a list of PmNo, which it then uses in PmActionsHandling.svc/$batch. Note that if there only are a few PMs connected, it simply does a basic GET, but I don’t know at what number it switches to batch.

Hi,

we ran into something similar once (for us it was getting WOs based on Serial no) and we applied a Flow workaround:
So we first fetched all the WO numbers, then formed a concatenated list from it (for the first 200 so that we avoid URI too long) and then used a Read (GET) and IN our concatenated list. After the data was fetched we added it to the table of results and looped to fetch the next 200 WOs untill we run out of WO numbers.

So a workaround because we failed to do a batch call…meaning i am interested too if someone has figured out how to do it properly :slight_smile:

Hope this helps!

B R
Ivan

1 Like

Thank you Ivan, I ended up using this solution! :slight_smile: Works like a charm.

1 Like