This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I'm relatively new to Alteryx, but a seasoned programmer.
I'm trying to build an Analytics App that allows the user to browse for an input data file, but I would like to validate that file before processing to ensure it contains the required fields.
IF input data does not contain fields [Name, Address, Date] THEN error message ELSE continue
I discovered the Field Info tool, but I'm confused how I can check the Field Input dataset for the existence of the proper fields and then return to the original Input Data dataset to continue processing. I searched pretty extensively, but the results I've found thusfar have just confused me more. :-o
I think you are looking for the Test Tool. You can have the input data branch off, and perform the test. If it fails it will raise an error. Perhaps add a "Block Until Done" on the main branch, so that the main branch will only run if there is no Error in the Test Tool.
I'm unsure how I would use the Block Until Done to wait for the Test tool, since the recordset that the Test Tool is testing is actually the Field Info... it isn't technically processing all rows of the Input Data. I'd love to learn how, if you have some pointers.
So I would pass the input dataset into the Block Until Done tool.; Then, the first anchor would perform your Field Info, followed by test, and your second anchor would go out to the rest of your workflow. This way, regardless of what it's actually processing, the whole dataset is getting sent down both paths (and then immediately reduced in the first path).
One other thing is that you'll need to change your Workflow Properties so that the workflow will terminate if the Test Tool throws an error. You can see a post by @JordanBhere that does this. In fact, doing it this way, I'm not certain you actually need the Block Until Done Tool. I just figured that it would ensure that the Test gets run before the rest of your workflow, so that time isn't wasted trying to process an invalid dataset.
Let me know if you have any trouble getting it to work,