Hi,
I am looking to replace a value in a multi-select field without impacting the other values selected as well. I have a form called 'projects' with two fields:
Example records for 'projects':
| 0001 | User1, User2 |
| 0002 | User2 |
I have another form called 'updates' with two fields:
I have set up an IFTTT for 'Update Confiform entries by filter', where it sets user=[entry.replace] based on a filter user:[entry.find]. The problem is that it replaces the whole value of the field, not just the user I am searching for. So if I submit a record in 'updates' as find=User2, replace=User3, the results would end up in 'projects' as:
| 0001 | User3 |
| 0002 | User3 |
instead of:
| 0001 | User1, User3 |
| 0002 | User3 |
Is there a way to only replace the multi-select value I am searching for? Would that work for both multi-select user and standard multi-select field types?
An extension of this question is, how can I add an additional value of an existing multi-select field without deleting the ones already there via an IFTTT instead of replacing one? I'd like to extend 'updates' by adding 'add' as a field and use that to add another value for the user field in 'projects'. So for example submitting add=User4 where reference:0002, then I end up:
| 0001 | User1, User3 |
| 0002 | User3, User4 |
Thank you in advance!
Peter
In case you are looking for an answer, I have managed to do it.
I created three additional holding fields on the form 'project':
userFind: single user type
userReplace: single user type
userSwap: multi-user type
I created an onCreate IFTTT on 'updates' as Update form based on filter (filter being user:[entry.find] ) and parameter to set: userFind=[entry.find] & userReplace=[entry.replace]. Essentially copying the values to the main form.
I created an onModify IFTTT on 'projects' as Create/Update value, trigger being hasChanged(userFind)= true AND userFind=*, parameter to set: entryId=[entry.id] & userSwap=[entry.user.asList.replaceWith([entry.userFind],[entry.userReplace])]
This one finds userFind as text and replaces with userReplace, as multi-select fields are stored as simple comma-separated string (=CSV)
I have created another IFTTT that overwrites 'user' with 'userSwap' and clears down the holding fields ready for the next update.
onModify IFTTT on 'projects' as Create/Update value, trigger being !userSwap=[empty] parameter to set: entryId=[entry.id] & user=[entry.userSwap] & userFind= & userReplace= & userSwap=
This would work on non-user based multi-select too as they are all stored as simple comma separated text strings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.