We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Issue in taking Multiple Values(Comma Separated Values) in Action Tool

Sanskriti22
7 - Meteor

Hi team,

Working on a query for action button attached to text box and mongo db tool.

I have formulated query for mongo db tool as attached below . But facing issues in creating a query for action tool, where #1 and #2 are dates, but now I have call multiple commas separated fields for #3 as updated in mogo db query already.

Comma separated field will look like – “Bin Fut 9:59:59 PM,Bitfin 10:59:59 AM,Blberg” . What should be updated while replacing #3 in action tool . 

3 REPLIES 3
GrowthNatives
8 - Asteroid

Hi @Sanskriti22,

If you're passing multiple comma-separated values (e.g., from a Text Box input like "Bin Fut 9:59:59 PM,Bitfin 10:59:59 AM,Blberg") into a MongoDB $in array via the Action Tool, you'll need to format those values properly as a JSON array.

Here’s how you can do it:

Replace(
  Replace(
    Replace([Destination], "2024-01-01", ToString([#1])),
    "2024-01-02", ToString([#2])
  ),
  "ABC", '["' + Replace(ToString([#3]), ",", '","') + '"]'
)

What it does:

  • Wraps each value in quotes.
  • Converts:
    "Bin Fut 9:59:59 PM,Bitfin 10:59:59 AM,Blberg"
    into
    ["Bin Fut 9:59:59 PM","Bitfin 10:59:59 AM","Blberg"]

This ensures your Mongo query receives a valid $in array when the Action Tool updates the query string.


Hope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!

🚀Let’s keep building smarter, data-driven solutions together! 🚀[Explore More]

Sanskriti22
7 - Meteor

I might have missed to mention this earlier csv field will called as it is but data in database is in tabular format for #3 - such as 

Source

Bin Fut 9:59:59 PM

Bitfin 10:59:59 AM

Blberg

If i am taking above mentioned than mongo db query attached will not work - {"DateAndTime": { "$gte" : { "$date" : "2025-05-08T00:00:00.000+0000"} } },{ "DateAndTime": { "$lte" : { "$date" : "2025-05-08T00:00:00.000+0000"} } },{"Source":{ "$in": ["ABC", "XYZ", "DEF"] }

I will get multiple row item to be called from source column but those multiple columns are comma separated format for query of action tool .

I hope this will make issue more clear .

GrowthNatives
8 - Asteroid

Hi @Sanskriti22,

Thanks for the clarification — now I see the #3 input is coming from a column of values (multi-row), not a single comma-separated string.

Here’s how to make that work:

  1. Use a Summarize Tool to Concatenate the Source field values using "," as the delimiter (and enable quote output).
  2. Use a Formula Tool to wrap the result like:
'["' + [Concatenated_Source] + '"]'
​

 

3. Connect that into your Action Tool, and replace "ABC" (or whatever placeholder you're using) in your Mongo query with this formatted array.

This will give you the correct $in array format like: ["Bin Fut 9:59:59 PM","Bitfin 10:59:59 AM","Blberg"]

 

Hope this solution helps you make the most of Alteryx! If it did, click 'Mark as Solution' to help others find the right answers.

💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!

🚀Let’s keep building smarter, data-driven solutions together! 🚀 [Explore more]

Labels
Top Solution Authors