Hello I was hoping to get some help on how to edit a repeating group with a custom state. The video above explains everything. What should I put as the new value of the custom state? If there is not a way to add a value here then what are some ways I could use to edit a repeating group with a custom state as a data source?
I do this with a Custom Event, with 2 parameters: Row, and InputText. Within this custom event, the step I add is to set the state. The value of the custom state is the custom stateâs list: each item:find & replace. On the Find & Replace dialog window, the Text to find is the parameter âRowâ. And I replace it with the parameter âInputTextâ.
Now I have a âpencilâ icon on each line, and when I click that pencil it shows that lineâs text in an input (and then I hide the text element). I then have a save button that appears, and clicking âsaveâ triggers the newly created Custom Event.
Here I define those parameters: âRowâ I set to âParent groups textâ. âInputTextâ I set to the Inputâs text (the one that appeared when the pencil icon was clicked). This also now hides the Input, and makes the text element (now with the newly edited text visible)
And hopefully that should point you where you need to go!
If you use custom states for this and arenât saving it to the database anywhere, you will lose any changes when the user refreshes the page. If you donât want that to happen you may want to run a workflow on the list returned by Chat GPT, save the lines to your database (perhaps attached to a datatype of script) and then use the result of that as your data source. That way any changes your user makes will also be saved.
There are a couple of different ways you could store the lines. You could save them as a list of texts on the parent data type and then use the great solution that @msgiblin explained (you may want to get ChatGpt to add a number to them at the beginning so that you can search by that just in case the same line appears multiple times in the script). Or each line could be itâs own piece of data and individually editable.
If you want more information about any of this just let me know.
Yes good notes! In my suggestions above, youâd still need to add a Save button and create a workflow to Make Changes to Thing, and then overwrite that thingâs script with the Custom Stateâs list of things.
Still having some issues with doing what you told me to do. Here is what I have so far.
Here are my parameters on the custom event. I wasnât sure what type to make them so i made them type âtextâ
However when I try to add the value of the custom state when i use âset stateâ it comes back broken âhighlighted redâ. I tried to find âlist: each item:find and replaceâ
Lastly Im guessing you want a popup to appear when you click the edit icon? If so, why is the current cellâs text not coming up in my popupâs input value? when I click the edit icon in the third cell, the inputâs value is not set to the 3rd cells value. Instead I see the whole entire response from chat gpt. Do I need to set a data source type to the popup?