Updating a field based on a list

Hi,

I’m attempting to build my first not-a-tutorial app. Parts are going well and parts are infuriating. Hoping someone can help with the latter.

I have a Data Type called Project Details. It includes a bunch of fields like “Creator”, “Project Name” and other obvious fields. It also includes a “status” field. This field draws values from an Option Set I created that contains a list of standard project statuses e.g. “New”, “Rejected”, “Waiting for Approval”, “In Progress” etc.

I created a project status page where a user can see all of the projects they have submitted. I also created an admin page where the projects can be updated by an admin.

What I want to do is:

  1. Create a Repeating Group that shows a list of all projects along with their status.
  2. For each row in the repeating group, have a drop down populated with all of the values of my Status Option Set.
  3. For each row in the repeating group, have an UPDATE button that changes the Status to whatever is selected in the dropdown.

I managed to get 1 & 2 working, but I cannot seem to figure out how to do #3.

It seems to me that I want a workflow that “When Button Update is clicked” proceeds to “Make Changes to a Thing” and then simply updates the Status field with the value from the dropdown. However, Bubble seems to disagree.

Any help would be much appreciated!

It definitely sounds like you are making great progress, @nick12… congrats!

If I am reading your post correctly, it sounds like you’ve got something like this…

projects

… and when you click the update button, you want the current status to change to the option that is selected in the dropdown, right?

If that’s what you are going for, then you are dead on… you need to make changes to the current cell’s project, and you would change its status to the dropdown value’s display. If that’s not working for you, I’m guessing you just need to tweak something in the workflow where you are making that change. If you can share a screenshot or two, I would be happy to try to help you figure it out.

Best…
Mike

1 Like

Thanks much for the offer of help!
Here’s the page, much as you surmised:

And here’s the Option Set I created:

And here’s the Data Type:

Ignore the field pdCurrentStatus1, it was just an experiment. You’ll see pdCurrentStatus pulls from the Option Set called projectStatus.

And here’s where I get stuck…

Under “thing to change” I see “Current User” and “Search For”. I presume the latter is the way to go. But that’s where things go pear shaped…

What did I miss?

Quick suggestions: Reload (refresh) your editor. Do you see new options?

IF the “Update” button is the button inside the repeating group cell (which it seems to be), what you “should” see is an option to make changes to “current cell’s Thing”. Did you perhaps select the wrong “Update” button as the trigger in your workflow?

I think it might be something with your repeating group because for Thing to change, you should have an option of Current cell’s Project Details. In other words, you shouldn’t have to do a search for anything there.

Can you show a screenshot of the setup of your repeating group?

I have a Vertical Scrolling, 4 row, 1 column repeating group. Type of content is TEXT.

The data source is currently Current User’s Submitted Projects:sorted (which actually is wrong as I want this to show the projects from all users, not just the currently logged in user).

Then I have 3 text boxes.

The first is just “Current Cell’s Text” and it returns an ID value I create for each project.

The second is a search for Project Details’ Project Name (a field in Project Details). It returns the project name.

The third is a search for Project Details’ CurrentStatus’s Display. It returns the current project status.

I then have a drop down with Dynamic Choices of Type TEXT. The source is All ProjectsStatus’s Display. (i.e. all of the values in the Option Set). Option Caption is set to Current Option.

Then I have the Update button.

As far as I can tell, everything is inside the group correctly. Here’s what the design screen looks like:

And here’s the final webpage…

And if I manually change the value of the project status, the page does update correctly.

p.s. No matter what, I only see two options under “Thing to change”. One is “Current User” and the other is “Search for…”

I’m reading through your entire response, but first off, the type of content for the repeating group should be Project Details.

Yup, that’s definitely the problem. You shouldn’t have to do those searches to get what you need for the repeating group. If you change the type of content of the repeating group to Project Details, you should have access to the data you want without having to search, and you should also get the appropriate option for Thing to change for the Update button in the workflow.

Hmm. Getting somewhere…

So Type of Content for the repeating group should be Project Details. Should the Data Source be “Search for Project Details”?

I now see Current Cell’s Project Details under things to change. I can select pdCurrentStatus as the field and put an “=”, but the “dropdown A” value is greyed out…

Yes, the Data source for the repeating group should be Search for Project Details.

If the dropdown is greyed out, it is probably a type mismatch. How is that dropdown configured?

Arrghhh. So close!

I’ve tried a couple of things.

Choices Style: Dynamic
Type of Choices: ProjectStatus
Choices Source: All projectStatus

And then
Choices Style: Dynamic
Type of Choices: text
Choices Source: All projectStatus’s Display

Here’s how I have mine set up…

I think I copied that exactly:

But the dropdown is still greyed out…

Thanks for your patience. I’m 99% certain I’ve just set something dumb somewhere.

Ahh. Just a thought, but in my data setup, should “pdCurrentStatus” just be text, and not be pointed at the Option Set list?

Hmm… if the pdCurrentStatus field has a type of projectStatus and the dropdown has the same type, it should’t be greyed out. There is no way this is going to work, but just for the heck of it, try to refresh your project or close it and reopen it again. Maybe it just doesn’t know it’s not a mismatch anymore? :slight_smile:

No luck with the refresh, but changing it to text made everything work. I can live with that :slight_smile:

One last question: how would I get the list of projects to show all projects, not just the projects for the currently logged in user?

If it works, it works. :slight_smile:

Do you have any constraints on your search for the repeating group?

I’m guessing you have one about the current logged in user, and you will need to remove it.

To get a list of all projects, just get a list of all projects. Note that privacy rules you’ve set up may prohibit the display of projects that do not belong to the “Current User”… And, as a result, you may NEVER be able to display a list of all projects. Which is as it should be.

Of course, you can create a privacy rule (e.g., “Current User is administrator”) that trumps all rules. And, in this way, you might see all projects.

But you should already know that, right?

1 Like

Yup, what Keith said, too. If you don’t have any constraints on your search, then it’s your privacy rules that are limiting the projects. Good stuff, Keith!

1 Like

Thanks for the assist here, @mikeloc. You know your stuff. Sometime, somebody needs to do a video (that nobody will ever watch, of course) that explains this stuff. Of course, nobody will ever do that because nobody will ever watch it. Classic Catch-22.