2025 Mar 12 5:54 PM - edited 2025 Mar 12 5:55 PM
Hello, I'm new to SAC and still learning how it works and I,ve stumbled upon a headscratcher.
I have a requirement where, in a table with multiple rows and columns, I'd like to display Field1 if the country filter value is set to Canada, and Field2 if the filter is set to US. All other fields in the table would be the same.
The filter is an All Pages filter.
I think this is feasable leveraging scripting, but I'm not sure how to go about it, any help would be appreciated.
Thank you!
Request clarification before answering.
As Nikhil has said, you can capture the filter value with a script.
You can then use script to add/remove dimensions from a table.
The code below uses the value selected in a dropdown, but you could just as easily use... If filter value =x etc
E. G. Apologies for the small image, posting on my phone
not sure if it's allowed, but...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its not clear on where you want to display the field when you say "I'd like to display Field1 if the country filter value is set to Canada, and Field2 if the filter is set to US. All other fields in the table would be the same. "
Assuming you want to display as Information you could try the below approach.
1. Use getDimensionFilters of Filedatasource to read the story filter values ( US or Canada)
FileDataSource.getDimensionFilters(dimension: string|+DimensionInfo)
2. Once you have read and stored the value assign the required value in a variable using a simple IF statement. Once assigned to variable you could assign it to a dynamic Text variable and show it as information.
Hope this helps !
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.