Setting Custom States from a workflow including ":Append" not working

Hi
I’m trying to create Unique Order numbers in my app. To do this I’m combining three things;

  1. The first 4 characters of the Current User’s Username
  2. The last 6 characters of the Current Date/Time UNIX Time Stamp
  3. A randomly generated 3 characters.

This works fine when testing in a Text because I can concatenate strings without using Append.
When creating a workflow to create this order number though, it’s not possible to Truncate a string after using :Append.

Here’s a screenshot of the only way I can get it to work (I’ve had to change the order of the elements of the UniqueRef around…)

Screen Shot 2022-03-18 at 16.47.50

Results in

Screen Shot 2022-03-18 at 16.48.36
(Mdevernon is the User’s Username - I can’t get it to truncate)

Trying to Truncate the Username…
Screen Shot 2022-03-18 at 16.51.52

Result
Screen Shot 2022-03-18 at 16.50.42

There’s no UserName (should be MDeVernon again)
Is this expected behaviour or something I’m doing wrong?

Many thanks
Joe

Looks like you need to say truncated to 10 after appending the User’s Name.

It seems like after you append the username and then truncate to 4, it is actually truncating the combined string of date and username to 4. That is why you have the first four numbers. If you say 10 then you will keep the 6 numbers from the date and the first four letters of the name.

Thank you so very much! And my apologies for going down the “is this a bug?” path - I’m suitably embarrassed because I thought I’d tried everything! This is the second time today a kind individual has saved me hours of banging my head against a wall trying to do something I’d never have worked out! Thank you again. It really makes sense now.
I can go and have a beer now. Have a lovely weekend.

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.