# New article number for created Product

**URL:** <https://community.glideapps.com/t/new-article-number-for-created-product/69502>\
**Category:** Ask for Help\
**Created:** [January 12, 2024, 10:53am UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502 "2024-01-12T10:53:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![epichungry](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/epichungry/32/65081_2.png) [@epichungry](https://community.glideapps.com/u/epichungry)\
**Post date:** [January 12, 2024, 10:53am UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/1 "2024-01-12T10:53:18Z")

</div>

Hi all.  
I’m trying to create a system of articles, but I can’t implement it.  
I need the last (highest) article to be taken when product creating . Also, it would be increased by 1.  
As a result, I need to create the new product wich have a unique article that is not repeated with anything from the list.

---

<div class="post-metadata">

**Author:** ![epichungry](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/epichungry/32/65081_2.png) [@epichungry](https://community.glideapps.com/u/epichungry)\
**Post date:** [January 12, 2024, 11:04am UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/2 "2024-01-12T11:04:17Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/f/8f0b779348ee22dd9aa8aa1f7292cb799c1ea81a.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/7/07bbbed78d508f3169e34973227bf5c33775d7ae.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/0/d009688118bdd0be78c95c078f91a84a016a4512.png)  
I tried to implement my idea like this.  
In “New Column” I count the number of “Row ID”. Next, I add 1 to “New Column A”. And with the action I put from “New Column A” to “PreArticle”

---

<div class="post-metadata">

**Author:** ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)\
**Post date:** [January 12, 2024, 11:05am UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/3 "2024-01-12T11:05:20Z")

</div>

Take a look at this: [How do I create an auto-incrementing row number with Glide Tables?](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572)

---

<div class="post-metadata">

**Author:** ![epichungry](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/epichungry/32/65081_2.png) [@epichungry](https://community.glideapps.com/u/epichungry)\
**Post date:** [January 12, 2024, 11:14am UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/4 "2024-01-12T11:14:02Z")

</div>

I already looked at this, but in the first method I was faced with the impossibility of using two different tables. The second one doesn’t suit me because it counts the number of lines and outputs a number based on the number. And when you remove any of the goods, the number decreases  
What I need is to take the last number and add 1 to it, and then put it in “PreArticle”

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 12, 2024, 1:21pm UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/5 "2024-01-12T13:21:48Z")

</div>

That needs to be part of your action flow. Take the last number of the last row, add 1 to it, and use a Set Column action to write the calculated number permanently to the PreArtical column.

> [@epichungry](#):
>
> I already looked at this, but in the first method I was faced with the impossibility of using two different tables.

What do you mean by this? Can you explain further?

---

<div class="post-metadata">

**Author:** ![epichungry](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/epichungry/32/65081_2.png) [@epichungry](https://community.glideapps.com/u/epichungry)\
**Post date:** [January 12, 2024, 2:51pm UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/6 "2024-01-12T14:51:35Z")

</div>

I meant that when creating an action, it is not possible to change values in two different tables in one action

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [January 12, 2024, 2:56pm UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/7 "2024-01-12T14:56:42Z")

</div>

You should be able to write to one table with the Set Column action, and then pull that value to another table with a Single Value or Relation column.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 12, 2024, 3:00pm UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/8 "2024-01-12T15:00:01Z")

</div>

Yeah, I’m not sure why you would want to write the same value to two different tables. As @nathanaelb said, you can retrieve the first, last, or any other values into another table with a single value column.

---

<div class="post-metadata">

**Author:** ![epichungry](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/epichungry/32/65081_2.png) [@epichungry](https://community.glideapps.com/u/epichungry)\
**Post date:** [January 12, 2024, 3:18pm UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/9 "2024-01-12T15:18:18Z")

</div>

I need to achieve this result:  
The number of products will periodically change up or down, I have a separate table in which the number should be stored. The cell should be simple. When the manager adds a new product, the first action must take the number from the cell, increase it, insert it into the table with the products, and then write the increased number back into the storage cell. The number should not decrease

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 12, 2024, 4:26pm UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/10 "2024-01-12T16:26:24Z")

</div>

> [@epichungry](#):
>
> and then write the increased number back into the storage cell.

You don’t need a storage cell unless you expect the last row to be deleted at any time before the next product is added. If that would never happen, then a single value column can retrieve the max PreArtical value when you need it, and a math column can add 1 to that number.

If the last entered product could be deleted, then the single value method won’t work because it would reassign a number that existed on the previously deleted item. In that case, yes you need to store the most recently assigned number somewhere. I think that would require a bit more knowledge of your data and app layout but generally I would suggest a separate table with a single row just to store this ID number. Then in the appropriate table, add a ‘Single Value’ → ‘Whole Row’ column that links to that new table. This will allow you to set column values through that single value, which works just like a single relation.

I just want to add that creating sequencial numbers in Glide is not ideal. At most it’s a hack. Operations are not atomic, so 2 users adding products at the exact same time can and will lead to duplicate numbers no matter what. These calculations to retrieve and add one to a number happen on the end user’s device, so by the time data syncs to the server and back to all other end user devices, you might run into conflicts where the same number was assigned to two different products. If products are being added by one user on one device, then you shouldn’t have a problem, but this is something to be mindful of if multiple people are adding products at the same time. In that case you need to involve an external service that can run atomic operations and process data sequentially to assign numbers.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 19, 2024, 4:26pm UTC](https://community.glideapps.com/t/new-article-number-for-created-product/69502/11 "2024-01-19T16:26:49Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
