Do you try to use the SelectRequestOptions addon to fetch the entry you are currently editing to reuse the categories, you typed in a different field?
If so, that addon has no option to apply dynamic values to the request.
Or - if I’m right and you are trying to reuse the categories from the current entry, write a custom field, that reads the current values und use them directly.
Again: please update your initial post and use fenced code blocks. You can’t expect anyone to answer your question, if you post some random code, that is hard to read. If people aren’t aware of the SelectRequestOptions addon and how it works, they wouldn’t even be able to guess your initial problem.
Let’s assume, the title of this thread would be “How to reuse values from a field while editing entry?” or “How to connect two fields in entry view?”.
Than, you would have started your initial post with some explanation about your goal to enter categories in the first field, to read them and to reuse them in the second field. Now it’s the time to talk about your try with the SelectRequestOptions addon.
Maybe there was a huge language barrier and you didn’t write about it. So you took some time to paint a sketch with arrows and fields to explain the logic visually.
You also remembered to use fenced code blocks, because I asked you to do so a few days ago in a different thread.
Now I wouldn’t feel like wasting my time.
OK, now I understand. Unfortunately there is no core field, that matches your conditions. If you want to write a custom field, have a look at UIkit v2, riot.js v3 and the core fields to understant the basic logic.
Than have a look at the SEO field, I wrote a while ago. It has a recursive function to find the root entry, so it works with collections, singletons and also if itself is nested (e. g. inside a set field).
Now you can access parent values of your current entry with
and use them as input for your custom field.
Even if your initial try would have worked in general, there was a bug in your php script.