# Update components

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-components%2F46755%3E%5C
**Category:** 🔒 Gradio\
**Created:** [July 13, 2023, 9:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-components%2F46755 "2023-07-13T21:11:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KPineda](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@KPineda](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FKPineda)%5C
**Post date:** [July 13, 2023, 9:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-components%2F46755%2F1 "2023-07-13T21:11:41Z")

</div>

Hi, everyone.  
I’m new in gradio and would like to know if someone can help me.

I want to add a hidden figure component in my app, and when the button is click, I want to update the figure component and make it visible, and then show my output in the figure component.  
I have seen some examples, however, some of them do the execution and then the figure component is updated.  
I want to start the execution, make visible the component, wait for the results and then show it in the visible component.  
Is that possible?  
Thanks for the help

---

<div class="post-metadata">

**Author:** ![KPineda](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@KPineda](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FKPineda)%5C
**Post date:** [July 18, 2023, 10:55pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-components%2F46755%2F2 "2023-07-18T22:55:02Z")

</div>

Hi, everyone.  
I could solve it using the then method.

I left a similar example in case someone need it.

```auto

import gradio as gr
import time

counter = 1

def visible_component(input_text):
    return gr.update(visible=True)

def generate_output(input_text):
    #gr.update(output_text,visible=True)
    global counter
    time.sleep(2)
    output_text = "Hello, " + input_text + "!"
    counter += 1
    return output_text

with gr.Blocks() as demo:
    with gr.Row():
    
        # column for inputs
        with gr.Column():
            input_text = gr.Textbox(label="Input Text")
            submit_button = gr.Button("Submit")
                   
        # column for outputs
        with gr.Column():
            output_text = gr.Textbox(visible=False)
            
    submit_button.click(
        fn=visible_component,
        inputs=input_text,
        outputs=output_text
    ).then(
        #time.sleep(2),
        fn=generate_output,
        inputs=input_text,
        outputs=output_text
        )

demo.launch()

```

---

<div class="post-metadata">

**Author:** ![binqiangliu](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@binqiangliu](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbinqiangliu)%5C
**Post date:** [September 28, 2023, 2:50pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-components%2F46755%2F3 "2023-09-28T14:50:36Z")

</div>

Facing this Gradio API call error:  
File “/home/user/.local/lib/python3.10/site-packages/gradio\_client/client.py”, line 824, in \_predict  
raise ValueError(result[“error”])  
ValueError: None

---

<div class="post-metadata">

**Author:** ![binqiangliu](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@binqiangliu](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbinqiangliu)%5C
**Post date:** [September 28, 2023, 2:52pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fupdate-components%2F46755%2F4 "2023-09-28T14:52:00Z")

</div>

Is there a kind of full guide regarding using Gradio api including named APIs and unnamed fn\_index APIs?  
Thanks and expecting an answer.
