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

Question

Question

Order Dates in multivalue token

asked on September 25, 2018 Show version history

Im trying to see if there is a way to use the Multi-Value token function for Sorting to work on Date values.  Is there any way to apply this?

The output should be ordered by Date Ascending. 

 

EDIT:  I am also binding the Document ID with the row as well:

9/4/2018, 6

9/11/2018, 7

9/12/2018, 10

9/21/2018, 13

0 0

Answer

SELECTED ANSWER
replied on September 26, 2018 Show version history

Hi Chase,

I received the same error when trying to retrieve field values from multiple documents.
As a workaround to this, I wrote those values to a sql table and afterward query them in order statement.

I know that this is not the neatiest way but it worked for me both for Date + Entry ID.
 

 

Hope that this help you!

test.png
test.png (53.16 KB)
1 0

Replies

replied on September 26, 2018 Show version history

Hello Chase,

I created a workflow and have been able to sort the date in ascending order.

Below is my workflow;

First my field type is set to Date.

 

In workflow, my Assign Token, ("Token Tags") is set to Date

Apply Function: Sort Ascending

Apply index: All values separated by mail

 

I used the email activity to test the results.

 

2 0
replied on September 26, 2018

I think the issue may just be that he is expecting the "Testing Area" in the token dialog to reflect the sorting. It does not. I think the Testing Area is only meant to be used with the Regular Expressions. The sorting should work when you actually test the process though, as the other posters are saying.

2 0
replied on September 26, 2018

Thanks Scott,  Yes when I'm mostly looking at the result,  I'm actually looking at the token output presented in the Workflow being run,

I removed the Document IDs and set the Date Token from String to Date and tested with no success still even through email as you have shown above.

But even so,  I need the Document ID linked with.  Once it is reordered, I would lose which document to refer to.

replied on September 26, 2018

i tested same and it worked for me

0 0
replied on September 26, 2018 Show version history

Thanks Scott,  Yes when I'm mostly looking at the result,  I'm actually looking at the token output presented in the Workflow being run,

I removed the Document IDs and set the Date Token from String to Date and tested with no success still even through email as you have shown above.

But even so,  I need the Document ID linked with.  Once it is reordered, I would lose which document to refer to.

Also my workflow is not grabbing a multi-value metadata field, these dates are coming from individual documents:

0 0
SELECTED ANSWER
replied on September 26, 2018 Show version history

Hi Chase,

I received the same error when trying to retrieve field values from multiple documents.
As a workaround to this, I wrote those values to a sql table and afterward query them in order statement.

I know that this is not the neatiest way but it worked for me both for Date + Entry ID.
 

 

Hope that this help you!

test.png
test.png (53.16 KB)
1 0
replied on September 26, 2018

That is exactly what I tested a bit ago as well!

I was trying to avoid additional connections or hops to SQL if possible but I know to order by date there with secondary information is simple.

Thanks a ton for verifying!

1 0
replied on September 26, 2018

No sure if this is acceptable, but can you format the date string in a way that sorts properly as a text search. Like yyyy-MM-dd?

1 0
replied on September 26, 2018

The behavior is correct. By appending the entry ID, you no longer have dates, you have strings and they're ordered alphabetically. "9/" is the same in both, but "2" is before "4", so at that point "9/25/2018, 6" is sorted before "9/4/2018, 7".

Scott's suggestion should work for dates, but be aware that alphabetically "9/4/2018, 16" will still come before "9/4/2018, 7".

0 0
replied on September 26, 2018

The problem i was having is in a multi-value token as a string it still didn't sort.

or I would have seen that behavior on the output.

I sent it to myself as an email to verify and it only sent the first value in the token.  Not all values.

0 0
replied on September 26, 2018

Did you format the token with a delimiter in your email? This is probably the same issue discussed here.

0 0
replied on September 26, 2018

Yes, by Line Break like the example given above from Mahesh.

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

Sign in to reply to this post.