I’m working on a project using the Show Form activity in UiPath, where users can select a job position from a form by clicking on a button. Each button corresponds to a different job, and clicking on a button should set the value of a workflow variable or argument (SelectedJob) to a predefined value (e.g., “Accountant” for the “Accountant” button).
Here’s what I’ve done so far:
Form Setup:
Added buttons for various job roles (e.g., Accountant, IT Engineer, etc.).
Configured each button with a Custom Property
Set the button action to Submit.
Workflow Configuration:
Created a variable SelectedJob (or argument, depending on the need) of type String in the workflow.
Mapped the SelectedJob in the Arguments of the Show Form activity as an Out parameter.
Issues Encountered:
After clicking on a button and submitting the form, the SelectedJob variable is still empty when I log its value using a Write Line or Log Message activity.
I have confirmed that the form is displayed correctly, and the buttons are clickable.
Additional Questions:
Is there a specific way I should initialize the SelectedJob variable before passing it to the form?
Are there any common pitfalls when setting up Custom Properties or Out parameters in the Show Form activity?
Do I need to configure Conditional or Logic settings for the buttons to ensure the value is assigned correctly?
Yes, I did use the Get Form Values activity to retrieve the values from the form. However, I encountered the following error:
“The form was not found. Please make sure that you have shown the form before and that the Instance Name you’re using is correct (FormNotFound).”
Here are the steps I took in my workflow:
I used the Show Form activity with an instance name set as "NewForm". In the form, I added buttons with custom properties to assign the SelectedJob key with corresponding values (e.g., “Accountant”).
I ensured that the Continue Workflow Execution option in Show Form was set to Off to prevent the workflow from executing further until the form interaction was complete.
Immediately after the Show Form activity, I added a Get Form Values activity, ensuring that the Instance Name was set as "NewForm" to match the name provided in the Show Form activity.
I used a Log Message activity to check the value of the SelectedJob variable, but it appears to be empty.
Despite these steps, the SelectedJob variable is not being assigned, and the Get Form Values activity throws the error mentioned above. I suspect there might be an issue with how the form is configured or how the SelectedJob key is mapped in the form.
Could you please help me identify what might be going wrong here? I’ve double-checked the documentation, and I believe the implementation matches the guidelines, but I’m missing something crucial.
Hey @r13722023
I use buttons as events in my flows. Then I use the Parallel activity, thanks to which I wait for the user to confirm that they have filled in the data until they confirm it by clicking the button.
Thanks to this, the form is always open and I can use the “get form values” and “close form” activities.
You can try it, but in my case it works smoothly.