Unique thing name = i can't edit the thing properly

Hey all,

I have a thing name Listings with fields Name, Description, and link.

When creating listings, i search for listings with the same name, and if one exists, i raise an error and do not complet the creation.
that works fine.

but now, when trying to edit the thing, i set the same workflow, “When button Save is clicked and when Search for Listings:count is 0” and it’s working perfectly as well.

The issue is, when someone wants to edit their Listing, even if they don’t touch the title and just edit the link or description, it raises an error because it’s trying to submit with the same title.

Is there any way around this?

you should check if that other item that has the same name is THIS item and ignore that match

could add this in the expression you use I guess

sorry reposting because screwed up the other posting:

I don’t know the details of your EDIT workflow (and you could provide them if you’d like for more clarity) but if you’d like the workflow to handle the title vs. link/description fields separately, you could create a custom workflow that addresses "if search for listings:count is 0"and “if search for listings:count >0” as a condition, and then trigger those custom workflow within the “press Save button” and “press Create button” workflows.

In other words, remove the “when Search for Listings:count is 0” from the button Save workflow’s conditions, and make it a separate custom workflow.

so it’d basically be:
[CREATE workflow, ie create button clicked] = [ CUSTOM listings count>0] —> [create Listing]
[EDIT workflow, ie save button clicked] = [edit Listing’s link/description] —- > [ CUSTOM listings count: 0 ] —> [ CUSTOM listings count>0]

[CUSTOM listing count: 0, workflow thing is Listing] = [edit Listing’s name]
[CUSTOM listings count>0] = [throw error]

thanks! what would this look like?

thanks for the reply! I’m not following what you’re saying, but here’s the basics of my edit workflow:

Firstly, only the things creator can see the edit button.
When clicked, it brings them to a page with the edit form, pre filled out with the current thing’s data.
The save button on the edit page has the “when Search for Listings:count is 0”, and the actions are it makes the chages to the listing, then redirects to the listing.

is thre any more info i could provide?

ok, I think I misunderstood what you were saying before. So yeah, building off what @birbilis is saying, it sounds like you have 3 scenarios:

  1. name is the same as before
  2. name is different, also doesn’t overlap with any other names
  3. name is different, but overlaps with other names

You can create 3 different “when Save button clicked” events, each with different conditionals.

For example’s sake let’s say the name of your Title Input field is Input_T. And I assume in this example that your page’s (let’s call it Page) content type is set to Listing (or maybe you have something on that page (maybe a state) that’s indicating the Listing’s unique ID. In whichever case, use that to see if the names are identical or not).

  1. Workflow: When Save button is clicked and when Input_T’s value is Page’s Listing’s title --> edit description/URL
  2. Workflow: When Save button is clicked and when Input_T’s value is not Page’s Listing’s title
    and “when Search for Listings:count is 0” --> edit name/description/URL
  3. Workflow: When Save button is clicked and when Input_T’s value is not Page’s Listing’s title
    and “when Search for Listings:count > 0” --> give user an error popup

A slight iteration and my personal preference (and what I was more getting at with my first posting) is to put these conditionals (Input_T’s value + Search for Listings:count) into 3 separate custom workflows, and only have 1 "when save button is clicked workflow with no conditionals. Then you would put those 3 separate custom workflows into the save button workflow. But this is an organizational issue more than anything.

1 Like

I came up with a solution, but i think i may change it to your solution. 3 workflows, while “costing more”, is more organized and i feel like it’s a little more scaleable.

Here, the workflow that is shown is the one that makes the change, the other is the one that raises the alert error.

So i programmed it to think “one of these must be true (thats what or means): There must be no listings with the same title, OR the inputed title is the same as the current listing’s title”. This satisfies your workflows 1 and 2.

the other one, as you can see, is simply checking if the title is used anywhere and raises the error, which satisfies your 3rd workflow.

I put it in my notes to look back at this thread and decide if i should go your route.

Thanks for your help!

great! your method results in an identical name getting re-submitted into the name field, but that’s not a big deal.

My sense is that there won’t be a cost difference here, but of course I haven’t tested it. In either case you’re going to be modifying the Listing once.

can you clarify what you mean by “your method results in an identical name getting re-submitted into the name field, but that’s not a big deal”?

I assume in your “make changes to Listing”, you’re changing the
name
description
URL

that means that under your OR condition, when “Current Page Listing’s Name is Input Tutorial Name’s value…” you’re re-modifying the name field, even though it’s already the same value. that’s all.

ah, ok. Yea, i don’t see any problem with that.