Right now I get no errors. However, the CSV that is created afterword contains no data. I am unsure if I am missing a step to get the data into the CSV properly.
After getting the program to write to PowerShell correctly, I would like some pointers on how to appoint each column from the baq to a variable within PowerShell.
I have gotten to a point where the code does the rest call successfully and writes all the data to a CSV file that is parsed. What I need to do now is transition the data I am collecting, in blue, into the post method, in green. I have not found a way to do this successfully code and snippets below:
The iteration will be part of it for sure. The main thing I’m trying to do right now is get the first entry from the Get method to then be posted to my end point. The issue is I have no clue how to take the data from the get and apply it to the post requirements.
For instance in my get method I have a JobHead_PartNumber and in my post method I have a JobHead_PartNumber. I would like to post the first entry from the get method but cant get my data to tie in.
If you could explain it easier in c# I can take it from there. Also thanks for the quick response!
Did you try making the rest calls in post man? You can get the call information from swagger, use that URL to build your call in post man, and postman has a tab that will give you code for a bunch of different languages. Including Powershell.
Out of curiosity, what are you trying to do? If you’re making a post call with the data you receive from the BAQ, couldn’t you just make the BAQ a UBAQ and do what you need to do there? Why pull it out, just to shove it back in again?
Oh, so the goal of this project is to create a streaming dataset with the results of that baq. Then make it all pretty within PowerBi and nest it within our SharePoint for distribution.
As a follow-up question I like that it can create the get code, but how do I then post that code to my endpoint?
So I have a specified endpoint that powerbi wants the data to go to with the post method. However, when I run the post for the endpoint I am greeted with the following error:
The original question had to do with whether or not Postman could handle endpoints. Now looking back at it, my question was poorly written, and kind of a dumb question.
We had used the “Get Odata Feed” option to get our data out of Epicor using baq calls and put them into our dataset. The issue is that by creating a dataset like that you are limited to 8 refreshes per day on your datasets.
Our goal in writing this out using the rest API is to create a “living” dataset that will refresh whenever new data is presented to it. Thanks for the reply though!
I think I’m, getting somewhere with what Jose posted earlier and troubleshooting with Postman. I solid returns coming from our baq and I get solid posts from the standard setup given to me by powerbi. My question now is whether or not I can create a Foreach value loop at the tail end of the convertto-json statement and whether or not that will give me returns for all of my entries. Have you done something like that before?
Alternatively you could use @josecgomez rest nuget in visual studio and make a rest call to your baq using c# and then write a foreach loop that runs through the BAQ response and outputs it to a .csv file or xml or whatever. You could pack that up into an executable and then use windows scheduler to run the exe every 15 minutes or whatever to update the file.
Not sure if you are more comfortable with powershell or something in visual studio.
But I haven’t ever done much of any of this. I did use powershell to specify a baq to DMT though which was cool. I am pretty sure there is an example of that in the ice tools book. And I think you had to output the baq to a file. However, this was not using rest.
Sorry Dylan, I’m a bit dense. Can you explain the business outcome without any reference to BAQ, REST, DataSet, PowerBI, or Postman? I hear how you want to do something but I’m still not clear on what the user’s desired outcome is.
The desired outcome of this project is to display our priority dispatch report and have it automatically refresh every five or so minutes. This will allow our team leads to prioritize jobs as needed and will keep them up to date without having to stop and print off another priority dispatch report. We want to have this displayed in each of our departments, be accessible for our corporate offices, and down the road be mounted at each machine. I have done something similar in the past but with limitations on the amount of times the data can be scheduled to be refreshed. To overcome these limitations I have been working on the project outlined above.
Postman question for you. I have a column that comes up in my response that I do not want to show up. In this case, it’s called “RowIdent”. I would like to filter out this column from the response and allow all my other items through.