<%# Eval("") %> can the "|" be removed if there is multiple choice?

Kristopher Maier asked on May 24, 2022 17:19

I have a multiple-choice field where a list of options is available and you can choose more than one. My issue is if I select more than one it displays the info as "check1|check2" I need to remove the "|" from what it pulls and have a space like "check1 check2". how do I edit what the eval displays without the"|"?

Thank you!

Correct Answer

Juraj Ondrus answered on May 26, 2022 05:22

Once you change the transformation type to text/XML, you can use macros - please see the macro documentation. The macros are basically coping the API - they are in 90% the same as you would use methods in C# code.

Is the "ApplicationList" a resource string you created in the Localization app? Or, why are you trying to use "GetResourceString"?
In your case you can use macro like {%FieldName%} to get the field's value. And if you want to remove the pipe characters, use C# standard string manipulation methods like Replace - {%FieldName.Replace("|", " ")%}

0 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on May 25, 2022 07:17

I would recommend switching to the text/XML transformation type and use macros - they have more options than the ASCX transformation as there is a way limited number of transformation methods. That being said, there is no ASCX transformation method to replace or remove parts of a string. You would need to create a custom transformation method.

0 votesVote for this answer Mark as a Correct answer

Kristopher Maier answered on May 25, 2022 16:13

I am new to macros...Am I able to display the information like the Eval code? <%# Eval("ApplicationsList") %>

I tried the following but it did not pull the info in. {% GetResourceString("ApplicationsList") %}

0 votesVote for this answer Mark as a Correct answer

Kristopher Maier answered on May 26, 2022 14:51

Thank you! this got me over my dilemma.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.