Hi Guys!
Long story short - I need to be able to take an XML file and use the data contained to either create an API call or generate a CSV that can be picked up by an external hotfolder.
The XML contains order information from EFI's online storefront which we need to use to trigger a job creation within our new MIS.
I haven't ever looked into this kind of thing before - any help would be greatly appreciated...
Thanks in advance.
Will
XML to either CSV or API call?
- magnussandstrom
- Advanced member
- Posts: 378
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: XML to either CSV or API call?
You need the Metadata Module in Switch to do this.
This is a flow thats starts with an XML pickup and three different outputs of choice:
XML pickup (metadata is asset) = This app "picks up" the XML and makes the different XML-values available for Switch (as metadata) so you can use that data downstream.
HTTP request = API communication
Create file from template = A free app where you can create CSV-files
CSV Creator = A paid app to create CSV-files
XML pickup (metadata is asset) "picks up" the XML and make the different values available for Switch (as metadata) so you can use that data for the output.
I hope this points you in the right direction
This is a flow thats starts with an XML pickup and three different outputs of choice:
XML pickup (metadata is asset) = This app "picks up" the XML and makes the different XML-values available for Switch (as metadata) so you can use that data downstream.
HTTP request = API communication
Create file from template = A free app where you can create CSV-files
CSV Creator = A paid app to create CSV-files
XML pickup (metadata is asset) "picks up" the XML and make the different values available for Switch (as metadata) so you can use that data for the output.
I hope this points you in the right direction
Last edited by magnussandstrom on Fri Feb 10, 2023 10:39 am, edited 3 times in total.
Re: XML to either CSV or API call?
Ahhh brilliant! I didnt even think about using the metadata pickup to do this... (yeah I know - i'm still learning as I go).
I have picked up the XML and can see it as metadata to reference - great!
How can I handle this if there are more than one "items" that have been ordered and so multiple order nodes in the XML? If that makes sense?
I have picked up the XML and can see it as metadata to reference - great!
How can I handle this if there are more than one "items" that have been ordered and so multiple order nodes in the XML? If that makes sense?
- magnussandstrom
- Advanced member
- Posts: 378
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: XML to either CSV or API call?
If you need to separate the order items (before sending them to the MIS) you can use XSLT transform (for that you need to configurate an XSL-file that suits you needs). Or take the short route and buy any of the XML apps thats avaliable in App-store, maybe Variable XPath Repeater or similar.
But the best approach (if possible) might be to send the whole job (including all order items) with API to the MIS. The MIS documentation should have a section what different options you have.
Last edited by magnussandstrom on Thu Feb 09, 2023 5:57 pm, edited 1 time in total.
Re: XML to either CSV or API call?
Hi!
Thanks for your help on this!
Managed to bodge an existing XLST app and mapping we have for something else...
Splits the order nodes out into individual XML files which I can then use downstream for API calls
Thanks again for your help!!!!!
Thanks for your help on this!
Managed to bodge an existing XLST app and mapping we have for something else...
Splits the order nodes out into individual XML files which I can then use downstream for API calls
Thanks again for your help!!!!!