Hello Alteryx community,
I am currently in the process of passing a call to an API. Some of the data for this call is present in a column in Alteryx which would be a set of numbers in rows within a Part Number column whose datatype is a "V_String". Please find the example table and API call below.
Sample Table
Part Number | Part Name | Part Available |
12345678A | NUT | Y |
14567890A | BOLT | N |
98765432A | ENGINE | N |
32109876A | CHASSIS | Y |
Sample API Call/Request
Solved! Go to Solution.
use transpose. Then build a Json pair using name/value. Use summarize tool to build this into one payload. Use download tool for your api.
Just one other small help if possible. I am trying to use Regex to Parse through JSON_Name column and get particular values which match the criteria.
JSON_Name | JSON_Name_After_Regex_Parse |
result.Parts.0.mfgPart.partPrefix | partPrefix |
result.Parts.0.mfgPart.partBase | partBase |
result.Parts.0.mfgPart.partSuffix | partSuffix |
result.partnerParts.0.partnerPartNumber | partnerPartNumber |
result.partnerParts.0.partnerPartName | partnerPartName |
result.partnerParts.0.partnerPartCompanyName | partnerPartCompanyName |
Can anyone please help on how to achieve this?
I referred this article. But those methods didn't work for me as I was unable to specify "." as a character in the Regex.
Solved: Regex extracting after last underscore - Alteryx Community
Hi @ssripat3
This should work. In regex a period is typically used to reference a character. In order to literally specify a period you need to prefix it with a slash (escape character).
.*\.(.*)
I used regex_replace([JSON_Name],"(\w+\.\d+\.)(\w+.*)$","$2") recently which should get you what you need. if you want the number to use in crosstabbing you could do:
([JSON_Name],"(\w+\.)(\d+)(\.)(\w+.*)$","$2") - to get the record number and
([JSON_Name],"(\w+\.)(\d+)(\.)(\w+.*)$","$4") - to get the JSON name
this assumes there are no non-word characters in any field names which worked in my case.
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |