Auto generating column values by "Set column Values" is not working

Hello All, I want work order numbers to auto generate in my “Work Order No” columns in glide sheet whenever I raise a new work order in the next row indicated in the attached below;

I used the formula “WO-” & YEAR(NOW()) & “-” & TEXT(ROWNUMBER(), “000”) in the workflow to set to set Column Values but it didn’t work.

Any help will be much appreciated.
Thanks.

You’re typing text inside the set column values action. It doesn’t work that way.

First up, there’s no concept of a “row number” variable in Glide. If you wish to do it that way, you would have to:

  • Create a rowID column.
  • Create a lookup targeting that rowID column to return an array of rowIDs.
  • Add a “Find Element Index” column, find the current rowID in the array above. It will return a 0-based list of indexes.
  • Add a math column to calculate the current year: YEAR(N) with N being the Now value.
  • Add an Excel Formula column and try to replicate what you did above, then on submission, wait for 5-10 seconds for the Excel Formula to not be empty, and set it to the work order no.

An issue you might want to address early on is what happens if an order is deleted. Since you seem to want to hardcode the order, deleting an order would cause a row number to be duplicated.

1 Like

What you are trying to do sounds very much like the first use case described in the post below:

Just be aware that the method does not guarantee uniqueness in the case where multiple users submit at the same time.

1 Like