Trouble setting Default value on drop-down field (dynamic from option set)

I found an existing topic that seems the same as mine, however the solution didn’t work for me.

I’m trying to set up my drop downs on a form to have a default value of the Service I’m editing, so my form can be used to create AND edit.

However, when I fill it out like the above, I get an error
Screenshot 2024-04-29 at 1.52.20 PM

I tried deleting and recreating the drop down, but it is still giving me the same error.

So you are saying Current page's Services's Category is not text but its type is option set Service Categories?

Yeah, my Service’s Category are option sets

Screenshot 2024-04-29 at 2.32.22 PM

Can you please show Services data type?

But I’m storing it in my DB like this… maybe that’s incorrect?
Screenshot 2024-04-29 at 2.33.28 PM

Yes. Thats incorrect. This should be of type option set as well.

If you like to insist storing as text (which is not good practice), then, while setting the default, you should filter all option sets by display value and get the one with this text in it.

1 Like

So, I should do this instead?

Yes, a starter.

That seems like it did the trick! Thank you!

Just curious, you said “a starter”… is there something else I need to consider?

I said because I dont know the context of your application and whethet that would help you or you would need other things :slight_smile:

I understand :slight_smile:
What you said was extremely helpful and has put me in the right direction. Thanks again!

1 Like

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