You are viewing limited content. For full access, please sign in.

Question

Question

How to remove the last character in a multi value string

asked on January 19, 2016

Hello,

I've created a multi-value token that places all values in a string separated by a comma. The problem I am having is there is a comma at the end of the string. How would I go about deleting this last character? My WorkFlow:

I am appending each value to the previous one with a modify token:

Everything is working perfectly except for the comma at the end of the string. How would I delete that?

 

Thanks

 

1 0

Replies

replied on January 20, 2016

The problem is %(For Each Value_Current Value) already contains the comma and you're not doing anything to remove it. You're actually adding an extra comma to your new token as you build a single value.

You can use token functions as Kevin suggested to remove the comma. The For Each Value loop is not necessary, you can apply the function to multi-value token directly.

The workflow will only need one Assign Tokens activity:

The activity creates a multi-value token using the field token from the previous activity:

Once you insert the Retrieve Field Values token, right-click it and choose Token Editor from the context menu.

Click in the Apply Function section and add Split and enter the comma to split on. Then add a Remove Empty Items function to remove any blank values that might appear after the split.

 

3 0
replied on January 19, 2016

Hey David,

Are you trying to use multiple values from Retrieve Field Values? If so, instead of into a loop at all, you can use the functions available from inside the Token Editor to split a multi-value token into a single value token, with all values separated by commas.

TokenEditor.png
TokenEditor.png (14.96 KB)
0 0
replied on January 20, 2016

Kevin, 

I've tried doing this, maybe I did something wrong? Below is a snapshot of my new workflow. I've selected apply index and All values separated by: Comma.

Any thoughts?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.