Changing a number in a list of numbers

Hi everyone!

I have something that I need to do and feel like it should be easy but just can’t get it to work.

I have a field within data type that is a list of number and I want to change one of the numbers in the list but keep at the same item number as the one I changed.

For example…

List - 2, 4, 6, 8, 10

I would like to change the “4” to a 7

List - 2, 7, 6, 8, 10

I have tried so many way but can’t seem to get this to work

1 Like

If you cannot have the same number twice in the list, you can use
A) plus item, minus item (but if “keep the same item number”, mean preserve order, this option will not preserve the order)
B) find and replace (will preserve the order)
C) each number is 4 format as text yes = 7, no = This number, converted to number (will preserve order too)
And probably some other option that I didn’t think

Thank you :slight_smile: I will try this out.

What is the list was…

2, 4, 4, 4, 6, 8

and I wanted to change it to

2, 4, 7, 4, 6, 8

Can you just remake the entire list every time? That way you don’t have to worry about changing anything. Just clear the list and then set it.

1 Like

Thank you.

Can you explain to me how that would work?

1 Like

My example only apply if you have different number. Your case is a little bit different. How will you find which number to replace in the list?

I can find when I would like to remove that number but removing it based on the items number in the list vs current cells item number but when I try to add a new number in that place, I can’t seem to figure that one out

Or you can create a backend workflow. Give them five key values. 1 - “index” which will be where in the list the item is. 2 - “number” which will be the number to change it to. 3 - The “data type” that the list is saved to. 4 = “iteration” which will be a number starting at 1. 5 - The “list”. Then give three actions in the following order. If “iteration” is 1, then make changes to “data type” clear list. If “iteration” is not “index”, make changes to “data type” list add “list”:item number “iteration”. If “iteration” is index, make changes to “data type” list add “number”. If “list”:count < “iteration”, Schedule API Workflow (“the same one”). “iteration” = “iteration” + 1; “index” = “index”; “number” = “number”; “list” = “list”; “data type” = “data type”.

Ohhhhhh that looks complicated.

Thank you, I will sit down and try to figure this one out

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