I'm creating a analytic app and this is what I would like to do.
First have a multi line text box where the user can just past in a list of codes, without having to comma separate them.
Then take that list and put it into a format like 'code1', 'code2', 'code3', etc. Then be able to take that and use it for the update value.
Any ideas. I don't now how to get the text input into the correct format for the update action tool.
Thanks,
Carol
Solved! Go to Solution.
Hi @cowannbell - Simply create a new field, update it, parse the values there and then update the required field with a Formula tool.
What do you mean by create a new field?
Just as an FYI: I have an in connect in database and I'm needing to update the statement "where GDAD00D.TBL_DAD_RATES_AUSH.RATE_SYS_CD in ('DP107')"
So I need to replace DP107 with the values that the user inputs. I know how to use the Action tool to update the statement but I can't figure out how to get a list like this
DP9X6
DP3XG
DP71G
DP8CW
Into this 'DP9X6','DP3XG','DP71G','DP8CW'
I've created an app before that does something similar. In my case I use a RegEx tool to tokenise codes out of the entered text since the codes are all in the same format, so that any other text gets ignored. In order to do that though, I use an action to update a text input tool with the entered text, which I can then run through other tools to get it in the required format.
In your case, I would similarly update a text input tool, then use RegEx or Text To Columns to separate the codes, then a Summarise tool to concatenate them with the correct punctuation. You could then feed that into a Dynamic Input tool.
If you need to keep it as a Connect In-DB, you could feed it into a macro instead with a new action to update the Connect tool.
What I'm updating is a Connect In DB and it has to remain that way. How would I feed a list of codes from a text input into a macro? The number of codes will vary each time.
Anyone else with ideas? I just want to find how on this app the user can just paste in the codes without having to separate by comma? Then take that multiline text box and split out each line to a column?
Hi @cowannbell ,
I've built an example for you. You input the Text in the multi-line text input like so:
This is in a workflow that updates a text input like so:
This then splits the multi line of text into rows, adds the single quote required in the select statement then concatenates together, so before the macro you end up with this:
This shows two text inputs, in single quotes, comma separated.
This is what is required in the select where clause.
This field goes into the macro as the parameter.
In the macro, the control parameter simply updates the Where clause:
The Action tool is configured to overwrite a specific part of the connection string:
select *
from AdventureWorks2017.Sales.SalesReason
Where Name in ('Price');
I've attached the exported workflow with the macro. You will need to open the macro and change the strings and everything accordingly.
Hope this helps,
M.
Okay, I'm getting there. I'm still a little confused when it comes to the macro. How do I put this in my gallery for other folks to run? I'm have updated all of the fields and links, so I'm good there.
I have not worked with macros at all in alteryx, so I'm confused on the one tool in the workflow, the round blue tool with no name. I can't see any setting or anything I can do with that tool. Can you advise what it is and what it does?
Okay, nevermind. I did figure out what that tool was. Still not sure about publishing to the gallery.
when you have proprietary macros you'll need to either upload the macros to the designer on the server, or export you entire main workflow (options->export workflow, then make sure you check the box beside the macro (but not the data inputs!). You can then get your gallery admin to upload the exported workflow to the gallery.
M.
User | Count |
---|---|
19 | |
15 | |
15 | |
8 | |
6 |