You’ll need to create an entity that has a generalisation from System.FileDocument in your domain model. In a microflow, create an instance of this entity and pass it into GetFileContentsFromResource (in Community Commons) along with the name of the local file you want to read in. This file needs to be in your application’s resources directory. You then pass the entity you created into StringFromFile (in CommunityCommons), which will return the contents of the file in a String.
So for example, if I want to load up a file called text.txt and show it, I can do the following.
Hope this helps.
Rather than trying to make your microflow read a local file, you can do follow the following:
Another solution, you could also:
Or, develop REST POST service and send the content of JSON via the REST service.
Thanks to both of you for your advice.
I picked the solution of running a Rest Post service locally on my machine since consuming a REST Call is closer to what I actually need for my project in the end.
I currently only need to test some of my code and thought a JSON would be easier to fetch locally from my machine instead of from a REST Service, but it seems I was wrong there. Learned something new about Mendix!