I have just created an activity with the name of InventorParams. I would like to add an alias as right now it shows up as: Guasamt.InventorParams+$LATEST in the activities list.
Now when POSTing the following request:
[
"id" => "prod"
]
Laravel will turn this into json. The Authorization header is also present
to https://developer.api.autodesk.com/da/us-east/v3/activities/:id/aliases. It either returns 400 or 404 errors. The 400 error is presented when using a fully qualified activity name. The 404 error is returned on all of the the following activity names:
Guasamt.InventorParams+LATEST (without $);
Guasamt.InventorParams;
InventorParams;
Now I'm wondering what should be the unqualified name of an activity?
When you create an Activity in FDA it gets a version number (since you just created it, it would be 1). This number needs to be used when creating Activity Alias, which is later used in the Work Item.
Your fully qualified name consist of <your_nick_name>.<activity_name>+<activity_version>. Where <your_nick_name> can be your ClientId if nickname was not specified.
Anyway I would recommend to follow the FDA tutorial. Another option on how to get quickly up to speed with FDA is to use the Autodesk Forge Tools addin to VS Code.
I have a source table, which receives all the fields as a space-separated string. So I am using the update policy to parse it first, do some manipulation and ingest it to the target table. But however, I am getting this error and don't know why. I have been stuck for hours, any help would really be appreciated.
.create function
UpdateFunction()
{
TempTable
| parse Record with Timestamp:datetime' 'HouseNo:string' 'Age:int' "'Adress:string'" "'Name:string'" 'Gender:string' 'CountryCode:string
| extend FullName = split(Path,"?")
| join kind=leftouter countryTable on $left.CountryCode==$right.CountryCode
| project "Admitted", Timestamp,House,Age,Adress,Country,tostring(FullName[0]),tostring(FullName[1])
}
a sample record will look like this-
20-12-2021 20B 7 "XYZ House, New York" "Anna Thomas" Female US
and my target table data should be like this
Admitted,20-12-2021,20B,21, XYZ House New York, United States, Anna, Thomas
countryTable has the country mapping to the corresponding country codes.
For next time, please include a request ID in your message. You can copy it from the web explorer using this button:
Assuming I was able to locate your requests correctly, I believe you had an extra open quotes at the end of the parse operator line, with no corresponding closing quote. I see some successful requests after that. Please reply back with a request ID if you are still experiencing the same issues.
Does anyone have an easy way to convert nested JSON to a flat SQL table? Just want to repeat the higher level data on each of the lower level detail. It looks like it can be done in mapping, I have tried as per the MS documentation but got a table full of NULL. Here is what I have tried and the result.
json
Option 1
Result: Only returns the first record of the ‘assignedLicences’
Option1
Option 2:
Returns multiple ‘assignedLicenses’ for each user, but only returns the first user id in each page.
Option2
Option3: as per the MS documentation
Result: returns all NULL values
Option3
You can have a try:
1.click import schemas button
2.if you have a JsonArray,select it.
3.you can directly see and edit the fields' JSON paths by opening Advanced editor .
Here is a Microsoft documentation about it.Please refer to this.
Hope this can help you.
If I have 5 vouchers in SQL server database staging table and I imported all 5 vouchers in tally using tally XML API.
How can I verify and cross check the vouchers between tally and SQL using only voucher number?
Do I have to read entire voucher summary from tally and then extract voucher numbers from the XML data ? After extracting voucher numbers I can compare it to staging table.
How can I just export only voucher number or one specific field from a report in tally ?
Do you know the voucher number after importing into Tally? Depending on the answer to this, I'll update my answer.
Case 1: If you do know the voucher number, you can use Tally XML to request for that particular voucher number and if you get a positive response, then that voucher exists in tally. No need to read voucher summary. You'll just need to look for a particular element tag in XML response - if that element exists = voucher exists.
Case 2: But I assume you don't know the voucher number that was created during the import. In that case. It'll be a bit more tricky. Let me know and I'll update with whatever solution I have.
--Update--
After discussing (see comments), I'm updating the answer as per Case 1.
XML Request Structure -
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>COLLECTION</TYPE>
<ID>FindParticularVoucher</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<SVCURRENTCOMPANY>FOO COMPANY</SVCURRENTCOMPANY>
<VCHNO>ABC1234</VCHNO>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<COLLECTION NAME="FindParticularVoucher" ISINITIALIZE="YES">
<TYPE>Voucher</TYPE>
<FILTER>GetInvoiceVoucher</FILTER>
</COLLECTION>
<VARIABLE NAME="VCHNO">
<TYPE>String</TYPE>
</VARIABLE>
<SYSTEM TYPE="FORMULAE" NAME="GetInvoiceVoucher">$VoucherNumber = $$String:##VCHNO</SYSTEM>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
Remember to change the Company name & Voucher Number within the SVCURRENTCOMPANY and VCHNO Xml Tags.
You might get a complex XML Response. All you need to do is look for the XML Node named Voucher within the Collection Node - Envelope/Body/Data/Collection/Voucher. If this VoucherNode exists = your voucher exists in tally. In this case you don't need to export any data or the voucher number.
When you create a voucher using XML in Tally, you would get a XML response on successful creation. That response has a tag for, among other things, the voucher number that you have given, and a LASTVCHID. This is like the master ID in tally. It's then easier to just request that master id and check the response. It would give an error if it doesn't find that master id (best of all, the error is just a one line XML response so no parsing required).
Check out this stackoverflow link for more details - how to filter tally xml response based on voucher number?
As part of a tool I am creating for my team I am connecting to an internal web service via PowerQuery.
The web service returns nested JSON, and I have trouble parsing the JSON data to the format I am looking for. Specifically, I have a problem with extracting the content of records in a column to a comma separated list.
The data
As you can see, the data contains details related to a specific "race" (race_id). What I want to focus on is the information in the driver_codes which is a List of Records. The amount of records varies from 0 to 4 and each record is structured as id: 50000 (50000 could be any 5 digit number). So it could be:
id: 10000
id: 20000
id: 30000
As requested, an example snippet of the raw JSON:
<race>
<race_id>ABC123445</race_id>
<begin_time>2018-03-23T00:00:00Z</begin_time>
<vehicle_id>gokart_11</vehicle_id>
<driver_code>
<id>90200</id>
</driver_code>
<driver_code>
<id>90500</id>
</driver_code>
</race>
I want it to be structured as:
10000,20000,30000
The problem
When I choose "Extract values" on the column with the list, then I get the following message:
Expression.Error: We cannot convert a value of type Record to type
Text.
If I instead choose "Expand to new rows", then duplicate rows are created for each unique driver code. I now have several rows per unique race_id, but what I wanted was one row per unique race_id and a concatenated list of driver codes.
What I have tried
I have tried grouping the data by the race_id, but the operations allowed when grouping data do not include concatenating rows.
I have also tried unpivoting the column, but that leaves me with the same problem: I still get multiple rows.
I have googled (and Stack Overflowed) this issue extensively without luck. It might be that I am using the wrong keywords, however, so I apologize if a duplicate exists.
UPDATE: What I have tried based on the answers so far
I tried Alexis Olson's excellent and very detailed method, but I end up with the following error:
Expression.Error: We cannot convert the value "id" to type Number. Details:
Value=id
Type=Type
The error comes from using either of these lines of M code (one with a List.Transform and one without):
= Table.Group(#"Renamed Columns", {"race_id", "begin_time", "vehicle_id"},
{{"DriverCodes", each Text.Combine([driver_code][id], ","), type text}})
= Table.Group(#"Renamed Columns", {"race_id", "begin_time", "vehicle_id"},
{{"DriverCodes", each Text.Combine(List.Transform([driver_code][id], each Number.ToText(_)), ","), type text}})
NB: if I do not write [driver_code][id] but only [id] then I get another error saying that column [id] does not exist.
Here's the JSON equivalent to the XML example you gave:
{"race": {
"race_id": "ABC123445",
"begin_time": "2018-03-23T00:00:00Z",
"vehicle_id": "gokart_11",
"driver_code": [
{ "id": "90200" },
{ "id": "90500" }
]}}
If you load this into the query editor, convert it to a table, and expand out the Value record, you'll have a table that looks like this:
At this point, choose Expand to New Rows, and then expand the id column so that your table looks like this:
At this point, you can apply the trick #mccard suggested. Group by the first columns and aggregate over the last using, say, max.
This last step produces M code like this:
= Table.Group(#"Expanded driver_code1",
{"Name", "race_id", "begin_time", "vehicle_id"},
{{"id", each List.Max([id]), type text}})
Instead of this, you want to replace List.Max with Text.Combine as follows:
= Table.Group(#"Changed Type",
{"Name", "race_id", "begin_time", "vehicle_id"},
{{"id", each Text.Combine([id], ","), type text}})
Note that if your id column is not in the text format, then this will throw an error. To fix this, insert a step before you group rows using Transform Tab > Data Type: Text to convert the type. Another options is to use List.Transform inside your Text.Combine like this:
Text.Combine(List.Transform([id], each Number.ToText(_)), ",")
Either way, you should end up with this:
An approach would be to use the Advanced Editor and change the operation done when grouping the data directly there in the code.
First, create the grouping using one of the operations available in the menu. For instance, create a column"Sum" using the Sum operation. It will give an error, but we should get the starting code to work on.
Then, open the Advanced Editor and find the code corresponding to the operation. It should be something like:
{{"Sum", each List.Sum([driver_codes]), type text}}
Change it to:
{{"driver_codes", each Text.Combine([driver_codes], ","), type text}}